1
1
mirror of https://github.com/github/semantic.git synced 2024-11-29 11:02:26 +03:00

Fix parse-examples

This commit is contained in:
Timothy Clem 2019-01-24 14:36:10 -08:00
parent 55bcef9093
commit 6fc3aec6c8

View File

@ -1,7 +1,9 @@
{-# LANGUAGE TypeApplications #-}
module Main (main) where
import Control.Exception (displayException)
import Control.Monad
import Control.Monad.IO.Class
import Control.Effect
import qualified Data.ByteString as B
import Data.ByteString.Builder
@ -15,10 +17,8 @@ import Data.Quieterm
import Data.Typeable (cast)
import Data.Void
import Parsing.Parser
import Rendering.Renderer
import Semantic.Config (Config (..), Options (..), defaultOptions)
import qualified Semantic.IO as IO
-- import Semantic.Parse
import Semantic.API (parseTermBuilder, TermOutputFormat(..))
import Semantic.Task
import Semantic.Task.Files
@ -102,8 +102,8 @@ languages =
-- , ("php", ".php") -- TODO: No parse-examples in tree-sitter yet
]
parseFilePath :: (Member (Error SomeException) sig, Member Task sig, Member Files sig, Carrier sig m, Monad m) => FilePath -> m Bool
parseFilePath path = readBlob (file path) >>= parseTermBuilder TermShow >>= const (pure True)
parseFilePath :: (Member (Error SomeException) sig, Member Distribute sig, Member Task sig, Member Files sig, Carrier sig m, MonadIO m) => FilePath -> m Bool
parseFilePath path = readBlob (file path) >>= parseTermBuilder @[] TermShow . pure >>= const (pure True)
languagesDir :: FilePath
languagesDir = "vendor/haskell-tree-sitter/languages"