1
1
mirror of https://github.com/github/semantic.git synced 2025-01-03 04:51:57 +03:00

🔥 dead code

This commit is contained in:
Rick Winfrey 2016-11-23 13:31:59 -06:00
parent 800f1b4c13
commit 32b323c892

View File

@ -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])