1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 13:02:37 +03:00

Add ParseJSON data type and DeriveAnyClass for ToJSON and Functor

This commit is contained in:
Rick Winfrey 2016-11-09 17:42:10 -06:00
parent f0ae836d03
commit 4d3c2b1c70

View File

@ -1,4 +1,5 @@
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators #-}
{-# LANGUAGE DataKinds, RankNTypes, TypeOperators, DeriveAnyClass #-}
module Parse where
import Arguments
@ -22,6 +23,8 @@ import TreeSitter
import Text.Parser.TreeSitter.Language
import Renderer.JSON()
data ParseJSON f a = ParseJSON { category :: Text, range :: Range, syntax :: Syntax f a, sourceText :: SourceText } deriving (Show, Generic, ToJSON, Functor)
run :: Arguments -> IO ()
run Arguments{..} = do
sources <- sequence $ readAndTranscodeFile <$> filePaths