mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
🔥 dead code
This commit is contained in:
parent
800f1b4c13
commit
32b323c892
13
src/Parse.hs
13
src/Parse.hs
@ -35,24 +35,11 @@ run Arguments{..} = do
|
||||
sources <- sequence $ readAndTranscodeFile <$> filePaths
|
||||
terms <- zipWithM (\parser sourceBlob -> parser sourceBlob) parsers (sourceBlobs sources)
|
||||
|
||||
let sourceBlobs = Source.SourceBlob <$> sources <*> pure mempty <*> filePaths <*> pure (Just Source.defaultPlainBlob)
|
||||
let parsers = parserWithSource <$> filePaths
|
||||
|
||||
terms <- zipWithM (\parser sourceBlob -> parser sourceBlob) parsers sourceBlobs
|
||||
|
||||
let termsWithParseJSON = (cata algebra <$> terms)
|
||||
|
||||
traverse_ (\ (annotation :< syntax) -> putStrLn annotation) (head $ runCofree <$> termsWithParseJSON)
|
||||
|
||||
pure ()
|
||||
where
|
||||
sourceBlobs sources = Source.SourceBlob <$> sources <*> pure mempty <*> filePaths <*> pure (Just Source.defaultPlainBlob)
|
||||
parsers = parserWithSource <$> filePaths
|
||||
algebra term = case term of
|
||||
(annotation :< syntax) -> cofree $ (ParseJSON category' range' sourceText') :< syntax
|
||||
where category' = toS $ Info.category annotation
|
||||
range' = characterRange annotation
|
||||
sourceText' = Info.sourceText annotation
|
||||
|
||||
-- | Return a parser that decorates with the cost of a term and its children.
|
||||
parserWithCost :: FilePath -> Parser (Syntax Text) (Record '[Cost, Range, Category, SourceSpan])
|
||||
|
Loading…
Reference in New Issue
Block a user