-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
207 additions
and
161 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* @chshersh @vrom911 | ||
* @vrom911 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
cabal-version: 2.4 | ||
name: extensions | ||
version: 0.0.0.1 | ||
version: 0.1.0.0 | ||
synopsis: Parse Haskell Language Extensions | ||
description: Parse Haskell Language Extensions. | ||
See [README.md](https://github.com/kowainik/extensions#extensions) for more details. | ||
|
@@ -10,14 +10,16 @@ license: MPL-2.0 | |
license-file: LICENSE | ||
author: Veronika Romashkina, Dmitrii Kovanikov | ||
maintainer: Kowainik <[email protected]> | ||
copyright: 2020 Kowainik | ||
copyright: 2020-2022 Kowainik | ||
category: GHC, Parsing, Haskell | ||
build-type: Simple | ||
extra-doc-files: README.md | ||
CHANGELOG.md | ||
tested-with: GHC == 8.8.4 | ||
GHC == 8.10.7 | ||
GHC == 9.0.2 | ||
GHC == 9.2.4 | ||
GHC == 9.4.2 | ||
|
||
flag executable | ||
description: Build the extensions executable | ||
|
@@ -29,7 +31,7 @@ source-repository head | |
location: https://github.com/kowainik/extensions.git | ||
|
||
common common-options | ||
build-depends: base >= 4.13.0.0 && < 4.16 | ||
build-depends: base >= 4.13.0.0 && < 4.18 | ||
|
||
ghc-options: -Wall | ||
-Wcompat | ||
|
@@ -47,6 +49,11 @@ common common-options | |
ghc-options: -Wmissing-deriving-strategies | ||
if impl(ghc >= 8.10.1) | ||
ghc-options: -Wunused-packages | ||
if impl(ghc >= 9.0) | ||
ghc-options: -Winvalid-haddock | ||
if impl(ghc >= 9.2) | ||
ghc-options: -Woperator-whitespace | ||
-Wredundant-bang-patterns | ||
|
||
default-language: Haskell2010 | ||
default-extensions: ConstraintKinds | ||
|
@@ -73,14 +80,14 @@ library | |
Extensions.Package | ||
Extensions.Types | ||
|
||
build-depends: bytestring ^>= 0.10 | ||
, Cabal >= 3.0 && < 3.5 | ||
build-depends: bytestring >= 0.10 && < 0.12 | ||
, Cabal >= 3.0 && < 3.9 | ||
, containers ^>= 0.6 | ||
, directory ^>= 1.3 | ||
, filepath ^>= 1.4 | ||
, ghc-boot-th >= 8.8.1 && < 9.1 | ||
, ghc-boot-th >= 8.8.1 && < 9.5 | ||
, parsec ^>= 3.1 | ||
, text ^>= 1.2.3 | ||
, text >= 1.2.3 && < 2.1 | ||
|
||
executable extensions | ||
import: common-options | ||
|
@@ -95,7 +102,7 @@ executable extensions | |
, containers | ||
, directory | ||
, filepath | ||
, optparse-applicative >= 0.15 && < 0.17 | ||
, optparse-applicative >= 0.15 && < 0.18 | ||
, text | ||
|
||
test-suite extensions-test | ||
|
@@ -111,10 +118,10 @@ test-suite extensions-test | |
, bytestring | ||
, containers | ||
, ghc-boot-th | ||
, hedgehog ^>= 1.0 | ||
, hedgehog >= 1.0 && < 1.3 | ||
, hspec | ||
, hspec-hedgehog ^>= 0.0.1 | ||
, text ^>= 1.2 | ||
, text | ||
ghc-options: -threaded | ||
-rtsopts | ||
-with-rtsopts=-N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
Copyright: (c) 2020-2022 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <[email protected]> | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
Copyright: (c) 2020-2022 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
Copyright: (c) 2020-2022 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{-# OPTIONS_GHC -fno-warn-orphans #-} | ||
|
||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE DeriveAnyClass #-} | ||
{-# LANGUAGE CPP #-} | ||
|
||
{- | | ||
Copyright: (c) 2020 Kowainik | ||
Copyright: (c) 2020-2022 Kowainik | ||
SPDX-License-Identifier: MPL-2.0 | ||
Maintainer: Kowainik <[email protected]> | ||
|
@@ -173,7 +173,9 @@ showOnOffExtension = \case | |
showExtension :: Extension -> Text | ||
showExtension = \case | ||
Cpp -> "CPP" | ||
#if !MIN_VERSION_ghc_boot_th(9,4,1) | ||
RecordPuns -> "NamedFieldPuns" | ||
#endif | ||
ext -> Text.pack $ show ext | ||
|
||
{- | Parse 'OnOffExtension' from a string that specifies extension. | ||
|
@@ -193,12 +195,14 @@ doesn't always work since some extensions are named differently. | |
readExtension :: String -> Maybe Extension | ||
readExtension = \case | ||
"GeneralisedNewtypeDeriving" -> Just GeneralizedNewtypeDeriving | ||
"NamedFieldPuns" -> Just RecordPuns | ||
"RecordPuns" -> Nothing | ||
"Rank2Types" -> Just RankNTypes | ||
"CPP" -> Just Cpp | ||
"Cpp" -> Nothing | ||
s -> readMaybe s | ||
#if !MIN_VERSION_ghc_boot_th(9,4,1) | ||
"NamedFieldPuns" -> Just RecordPuns | ||
"RecordPuns" -> Nothing | ||
#endif | ||
"Rank2Types" -> Just RankNTypes | ||
"CPP" -> Just Cpp | ||
"Cpp" -> Nothing | ||
s -> readMaybe s | ||
|
||
{- | Take accumulated 'OnOffExtension's, and merge them into one 'Set', | ||
excluding enabling of 'default2010Extensions'. | ||
|