mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
Pretend like we can make a module into a term.
This commit is contained in:
parent
58cffa4e4c
commit
bf2c4bc18b
@ -7,6 +7,7 @@ import Syntax
|
|||||||
import Control.Comonad.Cofree
|
import Control.Comonad.Cofree
|
||||||
import Control.Monad.Free
|
import Control.Monad.Free
|
||||||
import Data.Map
|
import Data.Map
|
||||||
|
import Data.Set
|
||||||
import Language.Haskell.Parser
|
import Language.Haskell.Parser
|
||||||
import Language.Haskell.Syntax
|
import Language.Haskell.Syntax
|
||||||
import System.Environment
|
import System.Environment
|
||||||
@ -26,5 +27,9 @@ parseModuleFile file = do
|
|||||||
contents <- readFile file
|
contents <- readFile file
|
||||||
return $ parseModule contents
|
return $ parseModule contents
|
||||||
|
|
||||||
|
moduleToTerm :: HsModule -> Term a Info
|
||||||
|
moduleToTerm (HsModule loc name exports imports declarations) = info :< Indexed [] where
|
||||||
|
info = Info Range { start = 0, end = 0 } Data.Set.empty
|
||||||
|
|
||||||
files (a : as) = (a, file as) where
|
files (a : as) = (a, file as) where
|
||||||
file (a : as) = a
|
file (a : as) = a
|
||||||
|
Loading…
Reference in New Issue
Block a user