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:
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 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,
|
||||
|
Loading…
Reference in New Issue
Block a user