mirror of
https://github.com/github/semantic.git
synced 2024-12-30 18:36:27 +03:00
Remove Java from AST parser plumbing
This commit is contained in:
parent
d48816c74d
commit
f0a34778ad
@ -12,8 +12,6 @@ module Parsing.Parser
|
||||
-- À la carte parsers
|
||||
, goParser
|
||||
, goASTParser
|
||||
, javaParser
|
||||
, javaASTParser
|
||||
, jsonParser
|
||||
, jsonASTParser
|
||||
, markdownParser
|
||||
@ -52,7 +50,6 @@ import qualified Language.TypeScript.Assignment as TypeScript
|
||||
import Prologue
|
||||
import TreeSitter.Go
|
||||
import TreeSitter.Haskell
|
||||
import TreeSitter.Java
|
||||
import TreeSitter.JSON
|
||||
import qualified TreeSitter.Language as TS (Language, Symbol)
|
||||
import TreeSitter.PHP
|
||||
@ -79,7 +76,6 @@ data SomeAnalysisParser typeclasses ann where
|
||||
|
||||
-- | A parser for some specific language, producing 'Term's whose syntax satisfies a list of typeclass constraints.
|
||||
someAnalysisParser :: ( ApplyAll' typeclasses Go.Syntax
|
||||
, ApplyAll' typeclasses Java.Syntax
|
||||
, ApplyAll' typeclasses PHP.Syntax
|
||||
, ApplyAll' typeclasses Python.Syntax
|
||||
, ApplyAll' typeclasses Ruby.Syntax
|
||||
@ -91,7 +87,6 @@ someAnalysisParser :: ( ApplyAll' typeclasses Go.Syntax
|
||||
-> SomeAnalysisParser typeclasses Location -- ^ A 'SomeAnalysisParser' abstracting the syntax type to be produced.
|
||||
someAnalysisParser _ Go = SomeAnalysisParser goParser (Proxy :: Proxy 'Go)
|
||||
someAnalysisParser _ Haskell = SomeAnalysisParser haskellParser (Proxy :: Proxy 'Haskell)
|
||||
someAnalysisParser _ Java = error "Java is currently unsupported pending grammar revisions"
|
||||
someAnalysisParser _ JavaScript = SomeAnalysisParser typescriptParser (Proxy :: Proxy 'JavaScript)
|
||||
someAnalysisParser _ PHP = SomeAnalysisParser phpParser (Proxy :: Proxy 'PHP)
|
||||
someAnalysisParser _ Python = SomeAnalysisParser pythonParser (Proxy :: Proxy 'Python)
|
||||
@ -183,7 +178,6 @@ data SomeASTParser where
|
||||
someASTParser :: Language -> Maybe SomeASTParser
|
||||
someASTParser Go = Just (SomeASTParser (ASTParser tree_sitter_go :: Parser (AST [] Go.Grammar)))
|
||||
someASTParser Haskell = Just (SomeASTParser (ASTParser tree_sitter_haskell :: Parser (AST [] Haskell.Grammar)))
|
||||
someASTParser Java = Just (SomeASTParser (ASTParser tree_sitter_java :: Parser (AST [] Java.Grammar)))
|
||||
someASTParser JSON = Just (SomeASTParser (ASTParser tree_sitter_json :: Parser (AST [] JSON.Grammar)))
|
||||
|
||||
-- Use the TSX parser for `.js` and `.jsx` files in case they use Flow type-annotation syntax.
|
||||
@ -196,5 +190,6 @@ someASTParser Ruby = Just (SomeASTParser (ASTParser tree_sitter_ruby :: Pa
|
||||
someASTParser TypeScript = Just (SomeASTParser (ASTParser tree_sitter_typescript :: Parser (AST [] TypeScript.Grammar)))
|
||||
someASTParser TSX = Just (SomeASTParser (ASTParser tree_sitter_tsx :: Parser (AST [] TSX.Grammar)))
|
||||
someASTParser PHP = Just (SomeASTParser (ASTParser tree_sitter_php :: Parser (AST [] PHP.Grammar)))
|
||||
someASTParser Java = Nothing
|
||||
someASTParser Markdown = Nothing
|
||||
someASTParser Unknown = Nothing
|
||||
|
Loading…
Reference in New Issue
Block a user