mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
Use languageForType to select a parser.
This commit is contained in:
parent
31fcf6e33c
commit
cbf313f011
@ -10,11 +10,7 @@ import Control.Comonad.Cofree
|
||||
type Parser = String -> IO (Term String Info)
|
||||
|
||||
parserForType :: String -> Parser
|
||||
parserForType mediaType = maybe lineByLineParser parseTreeSitterFile $ case mediaType of
|
||||
".h" -> Just ts_language_c
|
||||
".c" -> Just ts_language_c
|
||||
".js" -> Just ts_language_javascript
|
||||
_ -> Nothing
|
||||
parserForType mediaType = maybe lineByLineParser parseTreeSitterFile $ languageForType mediaType
|
||||
|
||||
lineByLineParser :: Parser
|
||||
lineByLineParser input = return . root . Indexed $ case foldl annotateLeaves ([], 0) lines of
|
||||
|
Loading…
Reference in New Issue
Block a user