1
1
mirror of https://github.com/github/semantic.git synced 2024-12-24 23:42:31 +03:00

Ingest exports/imports/declarations.

This commit is contained in:
Rob Rix 2015-11-20 08:55:19 -08:00
parent 2ac3f65b15
commit af0ebfa696

View File

@ -28,8 +28,12 @@ parseModuleFile file = do
return $ parseModule contents
moduleToTerm :: HsModule -> Term a Info
moduleToTerm (HsModule loc name exports imports declarations) = info :< Indexed [] where
moduleToTerm (HsModule loc name exports imports declarations) = info :< Indexed terms where
info = Info Range { start = 0, end = 0 } Data.Set.empty
exportTerms = exportSpecToTerm <$> maybe [] id exports
importTerms = importDeclarationToTerm <$> imports
declarationTerms = declarationToTerm <$> declarations
terms = exportTerms ++ importTerms ++ declarationTerms
exportSpecToTerm :: HsExportSpec -> Term a Info
exportSpecToTerm spec = _