1
1
mirror of https://github.com/github/semantic.git synced 2024-12-30 10:27:45 +03:00

🔥 SomeParser.

It’s unused.
This commit is contained in:
Rob Rix 2019-10-01 11:31:16 -04:00
parent d0aaef6da9
commit c0ecbb12b6
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7
3 changed files with 1 additions and 4 deletions

View File

@ -75,7 +75,6 @@ runParser blob@Blob{..} parser = case parser of
time "parse.cmark_parse" languageTag $
let term = cmarkParser blobSource
in length term `seq` pure term
SomeParser parser -> SomeTerm <$> runParser blob parser
where languageTag = [("language" :: String, show (blobLanguage blob))]
data ParserCancelled = ParserTimedOut | AssignmentTimedOut

View File

@ -65,7 +65,6 @@ runParser timeout blob@Blob{..} parser = case parser of
MarkdownParser ->
let term = cmarkParser blobSource
in length term `seq` pure term
SomeParser parser -> SomeTerm <$> runParser timeout blob parser
data ParseFailure = ParseFailure String
deriving (Show, Typeable)

View File

@ -112,8 +112,7 @@ data Parser term where
-> Parser (Term (Sum syntaxes) Loc)
-- | A parser for 'Markdown' using cmark.
MarkdownParser :: Parser (Term (TermF [] CMarkGFM.NodeType) (Node Markdown.Grammar))
-- | An abstraction over parsers when we dont know the details of the term type.
SomeParser :: ApplyAll typeclasses syntax => Parser (Term syntax ann) -> Parser (SomeTerm typeclasses ann)
-- | Apply all of a list of typeclasses to all of a list of functors using 'Apply'. Used by 'someParser' to constrain all of the language-specific syntax types to the typeclasses in question.
type family ApplyAll (typeclasses :: [(* -> *) -> Constraint]) (syntax :: * -> *) :: Constraint where