From eda990ad7b1dc889a42d32cf9995a0d649922c12 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 30 Jan 2017 14:03:22 -0800 Subject: [PATCH] Remove tree-sitter-parsers; replace with language specific packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - This allows us to migrate to haskell-tree-sitter, which provides an open source git repository that contains no language bindings, but provides the ffi for working with tree sitter. - Additionally now semantic-diff uses language specific packages found with the languages dir. Each language package contains a vendored version of its associated tree-sitter project (i.e. language/ruby contains tree-sitter-ruby). The implication is that generating a languageā€™s updated parser.c does not require a re-compilation of all languages parser.c files. --- semantic-diff.cabal | 6 +++++- src/Parse.hs | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/semantic-diff.cabal b/semantic-diff.cabal index 939d98410..4dc3a80b3 100644 --- a/semantic-diff.cabal +++ b/semantic-diff.cabal @@ -93,9 +93,13 @@ library , text >= 1.2.1.3 , text-icu , these - , tree-sitter-parsers + , haskell-tree-sitter , vector , wl-pprint-text + , c + , go + , ruby + , javascript default-language: Haskell2010 default-extensions: DeriveFunctor, DeriveFoldable, DeriveTraversable, DeriveGeneric, FlexibleContexts, FlexibleInstances, OverloadedStrings, NoImplicitPrelude, RecordWildCards, LambdaCase, StrictData ghc-options: -Wall -fno-warn-name-shadowing -O2 -fprof-auto -j diff --git a/src/Parse.hs b/src/Parse.hs index f1730dfef..f5cb6ced6 100644 --- a/src/Parse.hs +++ b/src/Parse.hs @@ -21,10 +21,13 @@ import Syntax import System.FilePath import Term import TreeSitter -import Text.Parser.TreeSitter.Language import Renderer import Renderer.JSON() import Renderer.SExpression +import Text.Parser.TreeSitter.C +import Text.Parser.TreeSitter.Go +import Text.Parser.TreeSitter.JavaScript +import Text.Parser.TreeSitter.Ruby data ParseJSON = ParseJSON { category :: Text