1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 05:58:34 +03:00

Format with one less indent

This commit is contained in:
Timothy Clem 2017-10-05 13:02:57 -07:00
parent 1c9c5e420e
commit 8f0e8bf151

View File

@ -195,15 +195,18 @@ runTaskWithOptions options task = do
runParser :: Options -> Blob -> Parser term -> Task term
runParser Options{..} blob@Blob{..} = go
where go :: Parser term -> Task term
where
go :: Parser term -> Task term
go parser = case parser of
ASTParser language -> logTiming "parse.tree_sitter_ast_parse" $
ASTParser language ->
logTiming "parse.tree_sitter_ast_parse" $
liftIO ((Right <$> parseToAST language blob) `catchError` (pure . Left . toException)) >>= either throwError pure
AssignmentParser parser assignment -> do
ast <- go parser `catchError` \ err -> do
writeStat (Stat.increment "parse.parse_failures" languageTag)
writeLog Error "failed parsing" (("tag", "parse") : blobFields) >> throwError err
logTiming "parse.assign" $ case Assignment.assign blobSource assignment ast of
logTiming "parse.assign" $
case Assignment.assign blobSource assignment ast of
Left err -> do
writeStat (Stat.increment "parse.assign_errors" languageTag)
let formatted = Error.formatError optionsPrintSource (optionsIsTerminal && optionsEnableColour) blob err