ghc-syntax-highlighter 0.0.3.0 → 0.0.3.1
raw patch · 6 files changed
+61/−4 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +5/−0
- GHC/SyntaxHighlighter.hs +11/−1
- README.md +1/−1
- data/LambdaCase.hs +4/−0
- ghc-syntax-highlighter.cabal +2/−2
- tests/GHC/SyntaxHighlighterSpec.hs +38/−0
CHANGELOG.md view
@@ -1,3 +1,8 @@+## GHC syntax highlighter 0.0.3.1++* Fixed the bug when certain extensions such as `-XLambdaCase` were not+ enabled when the code was compiled with GHC 8.6.+ ## GHC syntax highlighter 0.0.3.0 * Compiles with GHC 8.6.
GHC/SyntaxHighlighter.hs view
@@ -1,6 +1,6 @@ -- | -- Module : GHC.SyntaxHighlighter--- Copyright : © 2018 Mark Karpov+-- Copyright : © 2018–2019 Mark Karpov -- License : BSD 3 clause -- -- Maintainer : Mark Karpov <markkarpov92@gmail.com>@@ -432,7 +432,9 @@ = FfiBit | InterruptibleFfiBit | CApiFfiBit+#if !MIN_VERSION_ghc(8,6,0) | ParrBit+#endif | ArrowsBit | ThBit | ThQuotesBit@@ -468,6 +470,9 @@ | TypeApplicationsBit | StaticPointersBit | NumericUnderscoresBit+#if MIN_VERSION_ghc(8,6,0)+ | StarIsTypeBit+#endif deriving Enum -- | Extension we enable for the best user experience.@@ -477,7 +482,9 @@ [ FfiBit , InterruptibleFfiBit , CApiFfiBit+#if !MIN_VERSION_ghc(8,6,0) , ParrBit+#endif , ArrowsBit , ThBit , ThQuotesBit@@ -505,4 +512,7 @@ , TypeApplicationsBit , StaticPointersBit , NumericUnderscoresBit+#if MIN_VERSION_ghc(8,6,0)+ , StarIsTypeBit+#endif ]
README.md view
@@ -138,7 +138,7 @@ ## License -Copyright © 2018 Mark Karpov+Copyright © 2018–2019 Mark Karpov Distributed under BSD 3 clause license.
+ data/LambdaCase.hs view
@@ -0,0 +1,4 @@+foo :: Foo -> Maybe Bar+foo = \case+ Foo -> Just Bar+ _ -> Nothing
ghc-syntax-highlighter.cabal view
@@ -1,7 +1,7 @@ name: ghc-syntax-highlighter-version: 0.0.3.0+version: 0.0.3.1 cabal-version: 1.18-tested-with: GHC==8.4.4, GHC==8.6.2+tested-with: GHC==8.4.4, GHC==8.6.4 license: BSD3 license-file: LICENSE.md author: Mark Karpov <markkarpov92@gmail.com>
tests/GHC/SyntaxHighlighterSpec.hs view
@@ -14,6 +14,7 @@ it "parses a basic module" (withFile "data/Main.hs" basicModule) it "parses a type family" (withFile "data/TypeFamily.hs" typeFamily) it "parses an explicit forall" (withFile "data/Forall.hs" explicitForall)+ it "parses lambda case correctly" (withFile "data/LambdaCase.hs" lambdaCase) withFile :: FilePath -> [(Token, Text)] -> Expectation withFile path toks = do@@ -158,5 +159,42 @@ , (SymbolTok,"=") , (SpaceTok," ") , (VariableTok,"undefined")+ , (SpaceTok,"\n")+ ]++lambdaCase :: [(Token, Text)]+lambdaCase =+ [ (VariableTok,"foo")+ , (SpaceTok," ")+ , (SymbolTok,"::")+ , (SpaceTok," ")+ , (ConstructorTok,"Foo")+ , (SpaceTok," ")+ , (SymbolTok,"->")+ , (SpaceTok," ")+ , (ConstructorTok,"Maybe")+ , (SpaceTok," ")+ , (ConstructorTok,"Bar")+ , (SpaceTok,"\n")+ , (VariableTok,"foo")+ , (SpaceTok," ")+ , (SymbolTok,"=")+ , (SpaceTok," ")+ , (SymbolTok,"\\")+ , (SymbolTok,"case")+ , (SpaceTok,"\n ")+ , (ConstructorTok,"Foo")+ , (SpaceTok," ")+ , (SymbolTok,"->")+ , (SpaceTok," ")+ , (ConstructorTok,"Just")+ , (SpaceTok," ")+ , (ConstructorTok,"Bar")+ , (SpaceTok,"\n ")+ , (SymbolTok,"_")+ , (SpaceTok," ")+ , (SymbolTok,"->")+ , (SpaceTok," ")+ , (ConstructorTok,"Nothing") , (SpaceTok,"\n") ]