diff --git a/languages/javascript/Setup.hs b/languages/javascript/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/languages/javascript/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/languages/javascript/javascript.cabal b/languages/javascript/javascript.cabal new file mode 100644 index 000000000..6122994d4 --- /dev/null +++ b/languages/javascript/javascript.cabal @@ -0,0 +1,24 @@ +name: javascript +version: 0.1.0 +synopsis: tree-sitter javascript language bindings +description: Please see README.md +homepage: https://github.com/github/semantic-diff#readme +author: semantic-code +maintainer: tclem@github.com +copyright: 2017 GitHub +category: Web +build-type: Simple +-- extra-source-files: +cabal-version: >=1.10 + +library + hs-source-dirs: src + exposed-modules: Text.Parser.TreeSitter.JavaScript + build-depends: base >= 4.7 && < 5 + , haskell-tree-sitter + default-language: Haskell2010 + c-sources: vendor/tree-sitter-javascript/src/parser.c + +source-repository head + type: git + location: https://github.com/github/semantic-diff diff --git a/languages/javascript/src/Text/Parser/TreeSitter/JavaScript.hs b/languages/javascript/src/Text/Parser/TreeSitter/JavaScript.hs new file mode 100644 index 000000000..7fcbf30f7 --- /dev/null +++ b/languages/javascript/src/Text/Parser/TreeSitter/JavaScript.hs @@ -0,0 +1,6 @@ +module Text.Parser.TreeSitter.JavaScript where + +import Text.Parser.TreeSitter +import Foreign.Ptr + +foreign import ccall "vendor/tree-sitter-javascript/src/parser.c ts_language_javascript" ts_language_javascript :: Ptr Language diff --git a/languages/javascript/vendor/tree-sitter-javascript b/languages/javascript/vendor/tree-sitter-javascript new file mode 160000 index 000000000..97458010e --- /dev/null +++ b/languages/javascript/vendor/tree-sitter-javascript @@ -0,0 +1 @@ +Subproject commit 97458010e5ab4b3f178998078c708ef7e9e910d1