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:
parent
01a0bdc236
commit
1943a5a905
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user