Skip to content

Commit

Permalink
Add OrPatterns extensions (#10339)
Browse files Browse the repository at this point in the history
* Add OrPatterns extension

* Add changelog

* Add missing full stop

* Add missing NoMultilineStrings in vim syntax file

* Make test happy

* Remove changelog entry

We don't need it, changes have been manually
incorporated in 3.14 release notes (#10338)

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
ffaf1 and mergify[bot] committed Sep 15, 2024
1 parent efa04f7 commit 66d401b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Cabal-syntax/src/Language/Haskell/Extension.hs
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,11 @@ data KnownExtension
| -- | Allow the use of built-in syntax for list, tuple and sum type constructors
-- rather than being exclusive to data constructors.
ListTuplePuns
| -- | Support multiline strings
| -- | Support multiline strings.
MultilineStrings
| -- | Allow use of or-pattern syntax, condensing multiple patterns
-- into a single one.
OrPatterns
deriving (Generic, Show, Read, Eq, Ord, Enum, Bounded, Typeable, Data)

instance Binary KnownExtension
Expand Down
4 changes: 2 additions & 2 deletions Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ md5Check proxy md5Int = structureHash proxy @?= md5FromInteger md5Int

md5CheckGenericPackageDescription :: Proxy GenericPackageDescription -> Assertion
md5CheckGenericPackageDescription proxy = md5Check proxy
0xe40d8d67b85712f245354657d7a80165
0x09251b46ffc5178a7526d31e794d9c62

md5CheckLocalBuildInfo :: Proxy LocalBuildInfo -> Assertion
md5CheckLocalBuildInfo proxy = md5Check proxy
0x94827844fdb1afedee525061749fb16f
0x93b7e8ebb5b9f879fa5fe49b1708b43b
3 changes: 3 additions & 0 deletions editors/vim/syntax/cabal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ syn keyword cabalExtension contained
\ NullaryTypeClasses
\ NumDecimals
\ NumericUnderscores
\ OrPatterns
\ OverlappingInstances
\ OverloadedLabels
\ OverloadedLists
Expand Down Expand Up @@ -362,6 +363,7 @@ syn keyword cabalExtension contained
\ NoMonoLocalBinds
\ NoMonoPatBinds
\ NoMonomorphismRestriction
\ NoMultilineStrings
\ NoMultiParamTypeClasses
\ NoMultiWayIf
\ NoNPlusKPatterns
Expand All @@ -379,6 +381,7 @@ syn keyword cabalExtension contained
\ NoOverloadedLists
\ NoOverloadedRecordDot
\ NoOverloadedStrings
\ NoOrPatterns
\ NoPackageImports
\ NoParallelArrays
\ NoParallelListComp
Expand Down

0 comments on commit 66d401b

Please sign in to comment.