diff --git a/src/Parsing/TreeSitter.hs b/src/Parsing/TreeSitter.hs index f61217b83..7d37bdf2d 100644 --- a/src/Parsing/TreeSitter.hs +++ b/src/Parsing/TreeSitter.hs @@ -12,7 +12,6 @@ import Prologue import Control.Carrier.Reader import qualified Control.Exception as Exc import Foreign -import Foreign.C.Types (CBool (..)) import Data.AST (AST, Node (Node)) import Data.Blob @@ -85,7 +84,6 @@ runParse parseTimeout language Blob{..} action = liftIO . Exc.tryJust fromException . TS.withParser language $ \ parser -> do let timeoutMicros = fromIntegral $ toMicroseconds parseTimeout TS.ts_parser_set_timeout_micros parser timeoutMicros - TS.ts_parser_halt_on_error parser (CBool 1) compatible <- TS.ts_parser_set_language parser language if compatible then TS.withParseTree parser (Source.bytes blobSource) $ \ treePtr -> do diff --git a/test/Rendering/TOC/Spec.hs b/test/Rendering/TOC/Spec.hs index 369c36667..662b654ae 100644 --- a/test/Rendering/TOC/Spec.hs +++ b/test/Rendering/TOC/Spec.hs @@ -141,7 +141,7 @@ spec = do it "produces JSON output if there are parse errors" $ do blobs <- blobsForPaths (Path.relFile "ruby/toc/methods.A.rb") (Path.relFile "ruby/toc/methods.X.rb") output <- runTaskOrDie (runReader defaultLanguageModes (diffSummaryBuilder Format.JSON [blobs])) - runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.X.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"REMOVED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[{\"error\":\"expected end of input nodes, but got ParseError\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":3}}}]}]}\n" :: ByteString) + runBuilder output `shouldBe` ("{\"files\":[{\"path\":\"test/fixtures/ruby/toc/methods.A.rb -> test/fixtures/ruby/toc/methods.X.rb\",\"language\":\"Ruby\",\"changes\":[{\"category\":\"Method\",\"term\":\"bar\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":2,\"column\":4}},\"changeType\":\"REMOVED\"},{\"category\":\"Method\",\"term\":\"baz\",\"span\":{\"start\":{\"line\":4,\"column\":1},\"end\":{\"line\":5,\"column\":4}},\"changeType\":\"REMOVED\"}],\"errors\":[{\"error\":\"expected end of input nodes, but got ParseError\",\"span\":{\"start\":{\"line\":1,\"column\":1},\"end\":{\"line\":3,\"column\":1}}}]}]}\n" :: ByteString) it "ignores anonymous functions" $ do blobs <- blobsForPaths (Path.relFile "ruby/toc/lambda.A.rb") (Path.relFile "ruby/toc/lambda.B.rb")