From 66d401b5debc766ffc447e6b268284abb7141d48 Mon Sep 17 00:00:00 2001 From: ffaf1 Date: Sun, 15 Sep 2024 19:43:01 +0200 Subject: [PATCH] Add OrPatterns extensions (#10339) * 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> --- Cabal-syntax/src/Language/Haskell/Extension.hs | 5 ++++- Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs | 4 ++-- editors/vim/syntax/cabal.vim | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs index 13796c80666..dce34560586 100644 --- a/Cabal-syntax/src/Language/Haskell/Extension.hs +++ b/Cabal-syntax/src/Language/Haskell/Extension.hs @@ -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 diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index 3bdf0465244..025440c3598 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -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 diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index db08e8e0d92..2e578307a7e 100644 --- a/editors/vim/syntax/cabal.vim +++ b/editors/vim/syntax/cabal.vim @@ -232,6 +232,7 @@ syn keyword cabalExtension contained \ NullaryTypeClasses \ NumDecimals \ NumericUnderscores + \ OrPatterns \ OverlappingInstances \ OverloadedLabels \ OverloadedLists @@ -362,6 +363,7 @@ syn keyword cabalExtension contained \ NoMonoLocalBinds \ NoMonoPatBinds \ NoMonomorphismRestriction + \ NoMultilineStrings \ NoMultiParamTypeClasses \ NoMultiWayIf \ NoNPlusKPatterns @@ -379,6 +381,7 @@ syn keyword cabalExtension contained \ NoOverloadedLists \ NoOverloadedRecordDot \ NoOverloadedStrings + \ NoOrPatterns \ NoPackageImports \ NoParallelArrays \ NoParallelListComp