Skip to content

Commit

Permalink
Add the ExtendedLiterals extension (backport of haskell#8992)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleidukos committed Aug 20, 2023
1 parent bcabe6f commit 9faa4db
Show file tree
Hide file tree
Showing 4 changed files with 20 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 @@ -92,7 +92,7 @@ classifyLanguage = \str -> case lookup str langTable of

-- Note: if you add a new 'KnownExtension':
--
-- * also add it to the Distribution.Simple.X.languageExtensions lists
-- * also add it to the Distribution.Simple.X.compilerExtensions lists
-- (where X is each compiler: GHC, UHC, HaskellSuite)
--
-- | This represents language extensions beyond a base 'Language' definition
Expand Down Expand Up @@ -677,6 +677,9 @@ data KnownExtension =
-- | Enable data types for which an unlifted or levity-polymorphic result kind is inferred.
| UnliftedDatatypes

-- | Enable syntax for primitive numeric literals, e.g. @3#Int8@
| ExtendedLiterals

-- | Undocumented parsing-related extensions introduced in GHC 7.0.
| AlternativeLayoutRule

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 @@ -27,9 +27,9 @@ tests = testGroup "Distribution.Utils.Structured"
-- The difference is in encoding of newtypes
#if MIN_VERSION_base(4,7,0)
, testCase "GenericPackageDescription" $
md5Check (Proxy :: Proxy GenericPackageDescription) 0xa3e9433662ecf0c7a3c26f6d75a53ba1
md5Check (Proxy :: Proxy GenericPackageDescription) 0x8d8f340f10a58b8d8a87bf42213dac89
, testCase "LocalBuildInfo" $
md5Check (Proxy :: Proxy LocalBuildInfo) 0x91ffcd61bbd83525e8edba877435a031
md5Check (Proxy :: Proxy LocalBuildInfo) 0xbb22c3258d3092f31e992bc093d09170
#endif
]

Expand Down
10 changes: 10 additions & 0 deletions changelog.d/pr-8992
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
synopsis: Add language extension ExtendedLiterals
packages: Cabal-syntax
prs: #8992
significance: significant

description: {

- adds support for the ExtendedLiterals language extension (GHC proposal #451)

}
4 changes: 4 additions & 0 deletions editors/vim/syntax/cabal.vim
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ syn keyword cabalExtension contained
\ ExplicitNamespaces
\ ExtendedDefaultRules
\ ExtensibleRecords
\ ExtendedLiterals
\ FieldSelectors
\ FlexibleContexts
\ FlexibleInstances
Expand Down Expand Up @@ -299,6 +300,7 @@ syn keyword cabalExtension contained
\ NoDataKinds
\ NoDatatypeContexts
\ NoDefaultSignatures
\ NoDeepSubsumption
\ NoDeriveAnyClass
\ NoDeriveDataTypeable
\ NoDeriveFoldable
Expand All @@ -319,6 +321,7 @@ syn keyword cabalExtension contained
\ NoExplicitForAll
\ NoExplicitNamespaces
\ NoExtendedDefaultRules
\ NoExtendedLiterals
\ NoExtensibleRecords
\ NoFieldSelectors
\ NoFlexibleContexts
Expand Down Expand Up @@ -406,6 +409,7 @@ syn keyword cabalExtension contained
\ NoTransformListComp
\ NoTupleSections
\ NoTypeApplications
\ NoTypeData
\ NoTypeFamilies
\ NoTypeFamilyDependencies
\ NoTypeInType
Expand Down

0 comments on commit 9faa4db

Please sign in to comment.