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

Define a precise Python parser.

This commit is contained in:
Rob Rix 2019-09-26 13:50:20 -04:00
parent ead0253c73
commit f4d89746d1
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -24,6 +24,8 @@ module Parsing.Parser
, phpParser
, phpASTParser
, haskellParser
-- Precise parsers
, precisePythonParser
) where
import Assigning.Assignment
@ -57,6 +59,7 @@ import TreeSitter.JSON
import qualified TreeSitter.Language as TS (Language, Symbol)
import TreeSitter.PHP
import TreeSitter.Python
import qualified TreeSitter.Python.AST as Py
import TreeSitter.Ruby (tree_sitter_ruby)
import TreeSitter.TSX
import TreeSitter.TypeScript
@ -170,6 +173,10 @@ markdownParser :: Parser Markdown.Term
markdownParser = AssignmentParser MarkdownParser Markdown.assignment
precisePythonParser :: Parser (Py.Module Loc)
precisePythonParser = UnmarshalParser tree_sitter_python
data SomeTerm typeclasses ann where
SomeTerm :: ApplyAll typeclasses syntax => Term syntax ann -> SomeTerm typeclasses ann