1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 17:05:33 +03:00

Define a convenience to construct a Markdown parser.

This commit is contained in:
Rob Rix 2017-06-07 18:30:33 -04:00
parent 6af92900ff
commit 79389707fb

View File

@ -62,6 +62,9 @@ rubyParser = AssignmentParser (ASTParser tree_sitter_ruby) headF Ruby.assignment
pythonParser :: Parser Python.Term
pythonParser = AssignmentParser (ASTParser tree_sitter_python) headF Python.assignment
markdownParser :: Parser Markdown.Term
markdownParser = AssignmentParser MarkdownParser (\ ((nodeType :. location) :< _) -> Just (toGrammar nodeType) :. location) Markdown.assignment
runParser :: Parser term -> Source -> IO term
runParser parser = case parser of
ASTParser language -> parseToAST language