summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitryIvanov <>2017-06-19 19:19:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2017-06-19 19:19:00 (GMT)
commita4de2edfb8a9bebab667185cf7405c7ee825edef (patch)
tree6df0f7e3849cebc846e3cc8c0e8d0491aae41c55
parent54147d643edd918b42eab460319e43c65a72fd5c (diff)
version 0.14.00.14.0
-rw-r--r--test/Spec.hs1
-rw-r--r--test/Yi/Lexer/HaskellSpec.hs64
-rw-r--r--test/Yi/Lexer/Helpers.hs2
-rw-r--r--test/Yi/Lexer/Helpers/TH.hs30
-rw-r--r--yi-mode-haskell.cabal42
5 files changed, 2 insertions, 137 deletions
diff --git a/test/Spec.hs b/test/Spec.hs
deleted file mode 100644
index a824f8c..0000000
--- a/test/Spec.hs
+++ /dev/null
@@ -1 +0,0 @@
-{-# OPTIONS_GHC -F -pgmF hspec-discover #-}
diff --git a/test/Yi/Lexer/HaskellSpec.hs b/test/Yi/Lexer/HaskellSpec.hs
deleted file mode 100644
index d46048a..0000000
--- a/test/Yi/Lexer/HaskellSpec.hs
+++ /dev/null
@@ -1,64 +0,0 @@
-{-# LANGUAGE OverloadedStrings, FlexibleInstances #-}
-{-# LANGUAGE IncoherentInstances, UndecidableInstances #-}
-{-# LANGUAGE StandaloneDeriving, QuasiQuotes #-}
-{-# OPTIONS_GHC -fno-warn-orphans #-}
-
-module Yi.Lexer.HaskellSpec (main, spec) where
-
-
-import Control.Applicative ((<$>))
-import Prelude hiding (lex)
-import System.FilePath ((</>))
-import Test.Hspec
-import Yi.Buffer.Basic (Point(..))
-import Yi.Lexer.Alex
-import Yi.Lexer.Haskell
-import Yi.Lexer.Helpers.TH
-
-
-deriving instance Read OpType
-deriving instance Read ReservedType
-deriving instance Read CommentType
-deriving instance Read Token
-deriving instance Read Posn
-deriving instance Read Size
-deriving instance Read Point
-deriving instance Read a => Read (Tok a)
-
-newState :: AlexState HlState
-newState = AlexState initState 0 startPosn
-
-mkIndx :: String -> IndexedStr
-mkIndx = zip [1 ..]
-
-newInput :: String -> AlexInput
-newInput s = ('\n', [], mkIndx s)
-
-lex :: String -> [(AlexState HlState, TT)]
-lex s = unfoldLexer alexScanToken (newState, newInput s)
-
-lexTok :: String -> [TT]
-lexTok = map snd . lex
-
-lexToks :: String -> [Token]
-lexToks = map tokT . lexTok
-
-shouldLexToS :: FilePath -> [Token] -> Expectation
-shouldLexToS fp t = lexToks <$> readSample fp `shouldReturn` t
-
-lexesToS :: String -> [Token] -> Spec
-lexesToS s tt = it s $ s `shouldLexToS` tt
-
-readSample :: FilePath -> IO String
-readSample x = readFile $ "test" </> "test_data" </> x
-
-main :: IO ()
-main = hspec spec
-
-spec :: Spec
-spec = do
- describe "lexer tests" $ do
- it "fill me in" pending
- -- "Simple1.hs" `lexesToS` [ritFile|test/test_data/Simple1.hs_Token|]
- -- "Simple1Unicode.hs" `lexesToS` [ritFile|test/test_data/Simple1Unicode.hs_Token|]
- -- "UnicodeLiteral.hs" `lexesTo` [ritFile|test/test_data/UnicodeLiteral.hs_TToken|]
diff --git a/test/Yi/Lexer/Helpers.hs b/test/Yi/Lexer/Helpers.hs
deleted file mode 100644
index d097f79..0000000
--- a/test/Yi/Lexer/Helpers.hs
+++ /dev/null
@@ -1,2 +0,0 @@
-{-# LANGUAGE QuasiQuotes #-}
-module Yi.Lexer.Helpers where
diff --git a/test/Yi/Lexer/Helpers/TH.hs b/test/Yi/Lexer/Helpers/TH.hs
deleted file mode 100644
index b4472c4..0000000
--- a/test/Yi/Lexer/Helpers/TH.hs
+++ /dev/null
@@ -1,30 +0,0 @@
-module Yi.Lexer.Helpers.TH where
-
-import Language.Haskell.TH
-import Language.Haskell.TH.Quote
-
-literally :: String -> Q Exp
-literally = return . LitE . StringL
-
-withRead :: String -> Q Exp
-withRead s = return $ AppE (VarE $ mkName "read") (LitE $ StringL s)
-
-lit :: QuasiQuoter
-lit = QuasiQuoter { quoteExp = literally
- , quotePat = \s -> error s $ "quotePat: " ++ s
- , quoteType = \s -> error $ "quoteType: " ++ s
- , quoteDec = \s -> error $ "quoteDec: " ++ s}
-
-rlit :: QuasiQuoter
-rlit = QuasiQuoter { quoteExp = withRead
- , quotePat = \s -> error s $ "quotePat: " ++ s
- , quoteType = \s -> error $ "quoteType: " ++ s
- , quoteDec = \s -> error $ "quoteDec: " ++ s}
-
-
--- | Read file as-is.
-litFile :: QuasiQuoter
-litFile = quoteFile lit
-
-ritFile :: QuasiQuoter
-ritFile = quoteFile rlit
diff --git a/yi-mode-haskell.cabal b/yi-mode-haskell.cabal
index 2f3851b..6b21d36 100644
--- a/yi-mode-haskell.cabal
+++ b/yi-mode-haskell.cabal
@@ -3,7 +3,7 @@
-- see: https://github.com/sol/hpack
name: yi-mode-haskell
-version: 0.13.7
+version: 0.14.0
synopsis: Yi editor haskell mode
category: Yi
homepage: https://github.com/yi-editor/yi#readme
@@ -31,6 +31,7 @@ library
, array
, binary >= 0.7
, data-default
+ , filepath
, microlens-platform
, text
, yi-core
@@ -51,42 +52,3 @@ library
other-modules:
Paths_yi_mode_haskell
default-language: Haskell2010
-
-test-suite spec
- type: exitcode-stdio-1.0
- main-is: Spec.hs
- hs-source-dirs:
- test
- ghc-options: -Wall -ferror-spans
- include-dirs:
- src/Yi/Lexer
- build-depends:
- base >= 4.8 && < 5
- , array
- , binary >= 0.7
- , data-default
- , microlens-platform
- , text
- , yi-core
- , yi-language
- , yi-rope
- , base
- , array
- , binary
- , containers
- , data-default
- , filepath
- , hashable >=1.1.2.5
- , hspec
- , microlens-platform
- , pointedlist >= 0.5
- , regex-base ==0.93.*
- , regex-tdfa >= 1.1 && <1.3
- , template-haskell >= 2.4
- , transformers-base
- , unordered-containers >= 0.1.3 && < 0.3
- , QuickCheck == 2.*
- , yi-mode-haskell
- other-modules:
- Yi.Lexer.HaskellSpec Yi.Lexer.Helpers Yi.Lexer.Helpers.TH
- default-language: Haskell2010