1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 22:31:36 +03:00

Parse files to filepath, term pairs

This commit is contained in:
Timothy Clem 2018-02-12 16:17:35 -08:00
parent 01a0bdc236
commit 1943a5a905

View File

@ -32,12 +32,11 @@ type PythonValue = Value Precise (Term (Union Python.Syntax) (Record Location))
file :: MonadIO m => FilePath -> m Blob
file path = fromJust <$> IO.readFile path (languageForFilePath path)
files :: MonadIO m => [FilePath] -> m [Blob]
files = traverse file
parsePythonFiles :: [FilePath] -> IO [Python.Term]
parsePythonFiles paths = files paths
>>= runTask . traverse (parse pythonParser)
parsePythonFiles :: [FilePath] -> IO [(FilePath, Python.Term)]
parsePythonFiles paths = do
xs <- traverse file paths
ts <- runTask $ traverse (parse pythonParser) xs
pure (zip paths ts)
diffWithParser :: (HasField fields Data.Span.Span,
HasField fields Range,