nvim-hs 0.2.3 → 0.2.4
raw patch · 6 files changed
+42/−22 lines, 6 filesdep ~megaparsecbinary-added
Dependency ranges changed: megaparsec
Files
- api binary
- apiblobs/0.2.0.msgpack binary
- library/Neovim/API/Parser.hs +7/−10
- library/Neovim/Compat/Megaparsec.hs +21/−0
- library/Neovim/Plugin/ConfigHelper/Internal.hs +10/−10
- nvim-hs.cabal +4/−2
api view
binary file changed (16768 → 16949 bytes)
+ apiblobs/0.2.0.msgpack view
binary file changed (absent → 16949 bytes)
library/Neovim/API/Parser.hs view
@@ -1,8 +1,7 @@-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} {- | Module : Neovim.API.Parser-Description : Parser for the msgpack output stram API+Description : P.Parser for the msgpack output stram API Copyright : (c) Sebastian Witte License : Apache-2.0 @@ -30,14 +29,12 @@ import Data.Serialize import System.IO (hClose) import System.Process-import Text.Megaparsec as P-import Text.Megaparsec.String+import Neovim.Compat.Megaparsec as P import Text.PrettyPrint.ANSI.Leijen (Doc) import qualified Text.PrettyPrint.ANSI.Leijen as P import Prelude - data NeovimType = SimpleType String | NestedType NeovimType (Maybe Int) | Void@@ -163,23 +160,23 @@ parseType s = either (throwError . P.text . show) return $ parse (pType <* eof) s s -pType :: Parser NeovimType+pType :: P.Parser NeovimType pType = pArray P.<|> pVoid P.<|> pSimple -pVoid :: Parser NeovimType+pVoid :: P.Parser NeovimType pVoid = const Void <$> (P.try (string "void") <* eof) -pSimple :: Parser NeovimType+pSimple :: P.Parser NeovimType pSimple = SimpleType <$> some (noneOf [',', ')']) -pArray :: Parser NeovimType+pArray :: P.Parser NeovimType pArray = NestedType <$> (P.try (string "ArrayOf(") *> pType) <*> optional pNum <* char ')' -pNum :: Parser Int+pNum :: P.Parser Int pNum = read <$> (P.try (char ',') *> space *> some (oneOf ['0'..'9']))
+ library/Neovim/Compat/Megaparsec.hs view
@@ -0,0 +1,21 @@+{-# LANGUAGE CPP #-}+module Neovim.Compat.Megaparsec+ ( Parser+ , module X+ ) where+++import Text.Megaparsec as X++#if MIN_VERSION_megaparsec(6,0,0)++import Data.Void+import Text.Megaparsec.Char as X++type Parser = Parsec Void String++#else++import Text.Megaparsec.String as X++#endif
library/Neovim/Plugin/ConfigHelper/Internal.hs view
@@ -21,14 +21,14 @@ import Neovim.Quickfix import Neovim.Util (withCustomEnvironment) +import Neovim.Compat.Megaparsec as P hiding (count)+ import Config.Dyre (Params) import Config.Dyre.Compile import Config.Dyre.Paths (getPaths) import Control.Applicative hiding (many, (<|>)) import Control.Monad (void, forM_) import Data.Char-import Text.Megaparsec hiding (count)-import Text.Megaparsec.String import System.SetEnv import System.Directory (removeDirectoryRecursive) @@ -86,7 +86,7 @@ Left _ -> [] -pQuickfixListItem :: Parser (QuickfixListItem String)+pQuickfixListItem :: P.Parser (QuickfixListItem String) pQuickfixListItem = do _ <- many blankLine (f,l,c) <- pLocation@@ -100,29 +100,29 @@ , errorType = e } -pSeverity :: Parser QuickfixErrorType+pSeverity :: P.Parser QuickfixErrorType pSeverity = do try (string "Warning:" *> return Warning) <|> try (string "error:" *> return Error) <|> return Error -pShortDesrciption :: Parser String+pShortDesrciption :: P.Parser String pShortDesrciption = (:) <$> (notFollowedBy blankLine *> anyChar) <*> anyChar `manyTill` (void (some blankLine) <|> eof) -pLongDescription :: Parser String+pLongDescription :: P.Parser String pLongDescription = anyChar `manyTill` (blank <|> eof) where blank = try (try newline *> try blankLine) -tabOrSpace :: Parser Char+tabOrSpace :: P.Parser Char tabOrSpace = satisfy $ \c -> c == ' ' || c == '\t' -blankLine :: Parser ()+blankLine :: P.Parser () blankLine = void . try $ many tabOrSpace >> newline @@ -133,13 +133,13 @@ -- | Try to parse location information. -- -- @\/some\/path\/to\/a\/file.hs:42:88:@-pLocation :: Parser (String, Int, Int)+pLocation :: P.Parser (String, Int, Int) pLocation = (,,) <$> some (noneOf ":\n\t\r") <* char ':' <*> pInt <* char ':' <*> pInt <* char ':' <* many tabOrSpace -pInt :: Parser Int+pInt :: P.Parser Int pInt = read <$> some (satisfy isDigit) -- 1}}}
nvim-hs.cabal view
@@ -1,5 +1,5 @@ name: nvim-hs-version: 0.2.3+version: 0.2.4 synopsis: Haskell plugin backend for neovim description: This package provides a plugin provider for neovim. It allows you to write@@ -40,6 +40,7 @@ , test-files/compile-error-for-quickfix-test6 , test-files/hello , apiblobs/0.1.7.msgpack+ , apiblobs/0.2.0.msgpack , api extra-doc-files: CHANGELOG.md@@ -70,6 +71,7 @@ -- this library should have the freedom to do what she wants. , Neovim.API.String , Neovim.Classes+ , Neovim.Compat.Megaparsec , Neovim.Config , Neovim.Context , Neovim.Context.Internal@@ -115,7 +117,7 @@ , mtl >= 2.2.1 && < 2.3 , optparse-applicative , time-locale-compat- , megaparsec < 6+ , megaparsec , process , resourcet , setenv >= 0.1.1.3