mirror of
https://github.com/github/semantic.git
synced 2024-12-01 00:33:59 +03:00
Undo whitespace changes
This commit is contained in:
parent
8ad6dcb958
commit
83d3e3f77d
@ -30,7 +30,6 @@ import qualified Text.Parser.TreeSitter as TS
|
|||||||
import SourceSpan
|
import SourceSpan
|
||||||
import Info
|
import Info
|
||||||
|
|
||||||
|
|
||||||
-- | Returns a TreeSitter parser for the given language and TreeSitter grammar.
|
-- | Returns a TreeSitter parser for the given language and TreeSitter grammar.
|
||||||
treeSitterParser :: Language -> Ptr TS.Language -> Source -> IO (Term (Syntax.Syntax Text) (Record DefaultFields))
|
treeSitterParser :: Language -> Ptr TS.Language -> Source -> IO (Term (Syntax.Syntax Text) (Record DefaultFields))
|
||||||
treeSitterParser language grammar source = bracket ts_document_new ts_document_free $ \ document -> do
|
treeSitterParser language grammar source = bracket ts_document_new ts_document_free $ \ document -> do
|
||||||
@ -41,6 +40,7 @@ treeSitterParser language grammar source = bracket ts_document_new ts_document_f
|
|||||||
term <- documentToTerm language document source
|
term <- documentToTerm language document source
|
||||||
pure term
|
pure term
|
||||||
|
|
||||||
|
|
||||||
-- | Parse 'Source' with the given 'TS.Language' and return its AST.
|
-- | Parse 'Source' with the given 'TS.Language' and return its AST.
|
||||||
parseToAST :: (Bounded grammar, Enum grammar) => Ptr TS.Language -> Source -> IO (A.AST grammar)
|
parseToAST :: (Bounded grammar, Enum grammar) => Ptr TS.Language -> Source -> IO (A.AST grammar)
|
||||||
parseToAST language source = bracket ts_document_new ts_document_free $ \ document -> do
|
parseToAST language source = bracket ts_document_new ts_document_free $ \ document -> do
|
||||||
|
Loading…
Reference in New Issue
Block a user