From 85e1a5ab40407a2c643f850c5681d451cc88f551 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 12 Sep 2024 20:37:35 +0200 Subject: [PATCH 1/6] Add OrPatterns extension --- Cabal-syntax/src/Language/Haskell/Extension.hs | 3 +++ editors/vim/syntax/cabal.vim | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs index 13796c80666..50b720219e7 100644 --- a/Cabal-syntax/src/Language/Haskell/Extension.hs +++ b/Cabal-syntax/src/Language/Haskell/Extension.hs @@ -553,6 +553,9 @@ data KnownExtension ListTuplePuns | -- | 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/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index db08e8e0d92..92fda0e9b7a 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 @@ -379,6 +380,7 @@ syn keyword cabalExtension contained \ NoOverloadedLists \ NoOverloadedRecordDot \ NoOverloadedStrings + \ NoOrPatterns \ NoPackageImports \ NoParallelArrays \ NoParallelListComp From 9f74775a842778563102dd09b1da0e17d78bd2a8 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 12 Sep 2024 20:41:28 +0200 Subject: [PATCH 2/6] Add changelog --- changelog.d/pr-10339 | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/pr-10339 diff --git a/changelog.d/pr-10339 b/changelog.d/pr-10339 new file mode 100644 index 00000000000..c01d71234d4 --- /dev/null +++ b/changelog.d/pr-10339 @@ -0,0 +1,3 @@ +synopsis: Add support for `OrPatterns` GHC extension +packages: Cabal-syntax +prs: #10339 From 522157f3183221fad381e7b8aae7046d3d513ee2 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 12 Sep 2024 20:37:56 +0200 Subject: [PATCH 3/6] Add missing full stop --- Cabal-syntax/src/Language/Haskell/Extension.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cabal-syntax/src/Language/Haskell/Extension.hs b/Cabal-syntax/src/Language/Haskell/Extension.hs index 50b720219e7..dce34560586 100644 --- a/Cabal-syntax/src/Language/Haskell/Extension.hs +++ b/Cabal-syntax/src/Language/Haskell/Extension.hs @@ -551,7 +551,7 @@ 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. From 2869f9d031dc5a694efa1ab331a5a08db1ec9662 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 12 Sep 2024 20:48:07 +0200 Subject: [PATCH 4/6] Add missing NoMultilineStrings in vim syntax file --- editors/vim/syntax/cabal.vim | 1 + 1 file changed, 1 insertion(+) diff --git a/editors/vim/syntax/cabal.vim b/editors/vim/syntax/cabal.vim index 92fda0e9b7a..2e578307a7e 100644 --- a/editors/vim/syntax/cabal.vim +++ b/editors/vim/syntax/cabal.vim @@ -363,6 +363,7 @@ syn keyword cabalExtension contained \ NoMonoLocalBinds \ NoMonoPatBinds \ NoMonomorphismRestriction + \ NoMultilineStrings \ NoMultiParamTypeClasses \ NoMultiWayIf \ NoNPlusKPatterns From edc087683c0ef9e1902e59f62e3d7bfe57e4077a Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Thu, 12 Sep 2024 21:24:54 +0200 Subject: [PATCH 5/6] Make test happy --- Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 1976c1e9e56f00c4320bcad748e07b0e66245f9f Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Fri, 13 Sep 2024 17:28:21 +0200 Subject: [PATCH 6/6] Remove changelog entry We don't need it, changes have been manually incorporated in 3.14 release notes (#10338) --- changelog.d/pr-10339 | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 changelog.d/pr-10339 diff --git a/changelog.d/pr-10339 b/changelog.d/pr-10339 deleted file mode 100644 index c01d71234d4..00000000000 --- a/changelog.d/pr-10339 +++ /dev/null @@ -1,3 +0,0 @@ -synopsis: Add support for `OrPatterns` GHC extension -packages: Cabal-syntax -prs: #10339