From 496c009379aeaa24f6d9516d83f12e49eeb89c19 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 2 May 2017 14:53:07 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20pass=20the=20source=20through.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/TreeSitter.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TreeSitter.hs b/src/TreeSitter.hs index 8f4308786..49f5084c7 100644 --- a/src/TreeSitter.hs +++ b/src/TreeSitter.hs @@ -49,7 +49,7 @@ treeSitterParser language grammar blob = do -- | Parse Ruby to AST. Intended for use in ghci, e.g.: -- -- > Source.readAndTranscodeFile "/Users/rob/Desktop/test.rb" >>= parseRubyToAST >>= pure . uncurry (assignAll assignment) . second pure -parseRubyToAST :: Source -> IO (Source, A.AST Ruby.Grammar) +parseRubyToAST :: Source -> IO (A.AST Ruby.Grammar) parseRubyToAST source = do document <- ts_document_new ts_document_set_language document Ruby.tree_sitter_ruby @@ -63,7 +63,7 @@ parseRubyToAST source = do ast <- anaM toAST root ts_document_free document - pure (source, ast) + pure ast where toAST :: Node -> IO (A.RoseF (A.Node Ruby.Grammar) Node) toAST node@Node{..} = do let count = fromIntegral nodeChildCount