Skip to content

Commit

Permalink
Support GHC 9.10
Browse files Browse the repository at this point in the history
  • Loading branch information
TristanCacqueray committed Jan 7, 2025
1 parent c51d28d commit 479927e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
16 changes: 8 additions & 8 deletions proto3-suite.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ library

other-modules: Turtle.Compat

build-depends: aeson >= 1.1.1.0 && < 2.2,
build-depends: aeson >= 1.1.1.0 && < 2.3,
aeson-pretty,
attoparsec >= 0.13.0.1,
base >=4.15 && <5.0,
Expand All @@ -109,11 +109,11 @@ library
bytestring >=0.10.6.0 && <0.13,
deepseq >=1.4 && <1.6,
cereal >= 0.5.1 && <0.6,
containers >=0.5 && < 0.7,
containers >=0.5 && < 0.8,
contravariant >=1.4 && <1.6,
filepath,
foldl,
ghc >=9.0 && <9.9,
ghc >=9.0 && <9.11,
hashable,
insert-ordered-containers,
lens,
Expand All @@ -130,7 +130,7 @@ library
split,
system-filepath,
time,
text >= 0.2 && <2.2,
text >= 0.2 && <2.3,
text-short >=0.1.3 && <0.2,
transformers >=0.4 && <0.7,
turtle < 1.6.0 || >= 1.6.1 && < 1.7.0,
Expand Down Expand Up @@ -192,13 +192,13 @@ test-suite tests
Test.Proto.Parse.Option

build-depends:
aeson >= 1.1.1.0 && < 2.2
aeson >= 1.1.1.0 && < 2.4
, attoparsec >= 0.13.0.1
, base >=4.15 && <5.0
, base64-bytestring >= 1.0.0.1 && < 1.3
, bytestring >=0.10.6.0 && <0.13
, cereal >= 0.5.1 && <0.6
, containers >=0.5 && < 0.7
, containers >=0.5 && < 0.8
, deepseq >=1.4 && <1.6
, doctest
, generic-arbitrary
Expand All @@ -216,7 +216,7 @@ test-suite tests
, tasty-hedgehog
, tasty-hunit >= 0.9 && <0.11
, tasty-quickcheck >= 0.8.4 && <0.11
, text >= 0.2 && <2.2
, text >= 0.2 && <2.3
, text-short >=0.1.3 && <0.2
, transformers >=0.4 && <0.7
, turtle
Expand All @@ -242,7 +242,7 @@ executable canonicalize-proto-file
hs-source-dirs: tools/canonicalize-proto-file
default-language: Haskell2010
build-depends: base >=4.15 && <5.0
, containers >=0.5 && <0.7
, containers >=0.5 && <0.8
, mtl >=2.2 && <2.4
, optparse-generic
, proto3-suite
Expand Down
17 changes: 17 additions & 0 deletions src/Proto3/Suite/DotProto/Generate/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ instance SyntaxDefault SrcSpan
where
synDef = generatedSrcSpan

#if MIN_VERSION_ghc(9,10,0)

instance SyntaxDefault (EpAnn a)
where
synDef = noSrcSpanA

pattern PfxCon :: [arg] -> HsConDetails Void arg r
pattern PfxCon args = PrefixCon [] args

#else

#if MIN_VERSION_ghc(9,8,0)

instance SyntaxDefault (HsBndrVis GhcPs)
Expand Down Expand Up @@ -211,6 +222,8 @@ instance SyntaxDefault e => SyntaxDefault (GenLocated SrcSpan e)
where
synDef = noLocA synDef

#endif

pattern PfxCon :: [arg] -> HsConDetails arg r
pattern PfxCon args = PrefixCon args

Expand Down Expand Up @@ -355,7 +368,11 @@ module_ moduleName maybeExports imports decls = GHC.HsModule
#if MIN_VERSION_ghc(9,6,0)
hsmodExt = XModulePs
{ hsmodAnn = synDef
#if MIN_VERSION_ghc(9,10,0)
, hsmodLayout = EpVirtualBraces 2
#else
, hsmodLayout = VirtualBraces 2
#endif
, hsmodDeprecMessage = Nothing
, hsmodHaddockModHeader = Nothing
}
Expand Down

0 comments on commit 479927e

Please sign in to comment.