1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +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 :: MonadIO m => FilePath -> m Blob
file path = fromJust <$> IO.readFile path (languageForFilePath path) file path = fromJust <$> IO.readFile path (languageForFilePath path)
files :: MonadIO m => [FilePath] -> m [Blob] parsePythonFiles :: [FilePath] -> IO [(FilePath, Python.Term)]
files = traverse file parsePythonFiles paths = do
xs <- traverse file paths
parsePythonFiles :: [FilePath] -> IO [Python.Term] ts <- runTask $ traverse (parse pythonParser) xs
parsePythonFiles paths = files paths pure (zip paths ts)
>>= runTask . traverse (parse pythonParser)
diffWithParser :: (HasField fields Data.Span.Span, diffWithParser :: (HasField fields Data.Span.Span,
HasField fields Range, HasField fields Range,