Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OrPatterns extension (backport #10339) #10360

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading