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:
parent
d0aaef6da9
commit
c0ecbb12b6
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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 don’t 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
|
||||
|
Loading…
Reference in New Issue
Block a user