1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00
semantic/app/Main.hs

47 lines
1.3 KiB
Haskell
Raw Normal View History

2015-11-18 01:44:16 +03:00
module Main where
import Diff
import Patch
import Term
import Syntax
import Control.Comonad.Cofree
import Control.Monad.Free
import Data.Map
2015-11-21 00:21:09 +03:00
import Data.Maybe
import Data.Set
2015-11-20 19:36:54 +03:00
import Language.Haskell.Parser
import Language.Haskell.Syntax
import System.Environment
2015-11-24 21:15:45 +03:00
import GHC.Generics
import Foreign
import Foreign.CStorable
import Foreign.C.Types
data TSLanguage = TsLanguage deriving (Show, Eq, Generic, CStorable)
foreign import ccall "prototype/doubt-difftool/doubt-difftool-Bridging-Header.h ts_language_c" ts_language_c :: IO (Foreign.Ptr TSLanguage)
2015-11-24 21:23:29 +03:00
data TSDocument = TsDocument deriving (Show, Eq, Generic, CStorable)
foreign import ccall "prototype/External/tree-sitter/include/tree_sitter/runtime.h ts_document_make" ts_document_make :: IO (Foreign.Ptr TSDocument)
2015-11-18 01:44:16 +03:00
main :: IO ()
2015-11-20 19:36:54 +03:00
main = do
2015-11-24 21:41:30 +03:00
-- args <- getArgs
-- return f
-- let (a, b) = files args in do
-- -- a' <- parseModuleFile a
-- -- b' <- parseModuleFile b
-- return f
-- return ()
document <- ts_document_make
2015-11-24 21:42:09 +03:00
putStrLn $ "cSizeOf " ++ show (cSizeOf document)
2015-11-20 19:36:54 +03:00
parseModuleFile :: FilePath -> IO (ParseResult HsModule)
parseModuleFile file = do
contents <- readFile file
return $ parseModule contents
files (a : as) = (a, file as) where
file (a : as) = a
2015-11-24 21:40:07 +03:00
files [] = error "expected two files to diff"