From 3e8bbcb50458421cef7d89b411e51055bd7f28bf Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Mon, 30 Jan 2017 14:00:19 -0800 Subject: [PATCH] Add languages/c --- languages/c/Setup.hs | 2 ++ languages/c/c.cabal | 24 +++++++++++++++++++++ languages/c/src/Text/Parser/TreeSitter/C.hs | 6 ++++++ languages/c/vendor/tree-sitter-c | 1 + 4 files changed, 33 insertions(+) create mode 100644 languages/c/Setup.hs create mode 100644 languages/c/c.cabal create mode 100644 languages/c/src/Text/Parser/TreeSitter/C.hs create mode 160000 languages/c/vendor/tree-sitter-c diff --git a/languages/c/Setup.hs b/languages/c/Setup.hs new file mode 100644 index 000000000..9a994af67 --- /dev/null +++ b/languages/c/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/languages/c/c.cabal b/languages/c/c.cabal new file mode 100644 index 000000000..cda8b6b69 --- /dev/null +++ b/languages/c/c.cabal @@ -0,0 +1,24 @@ +name: c +version: 0.1.0 +synopsis: tree-sitter c 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.C + build-depends: base >= 4.7 && < 5 + , haskell-tree-sitter + default-language: Haskell2010 + c-sources: vendor/tree-sitter-c/src/parser.c + +source-repository head + type: git + location: https://github.com/github/semantic-diff diff --git a/languages/c/src/Text/Parser/TreeSitter/C.hs b/languages/c/src/Text/Parser/TreeSitter/C.hs new file mode 100644 index 000000000..6d682d0ce --- /dev/null +++ b/languages/c/src/Text/Parser/TreeSitter/C.hs @@ -0,0 +1,6 @@ +module Text.Parser.TreeSitter.C where + +import Text.Parser.TreeSitter +import Foreign.Ptr + +foreign import ccall "vendor/tree-sitter-c/src/parser.c ts_language_c" ts_language_c :: Ptr Language diff --git a/languages/c/vendor/tree-sitter-c b/languages/c/vendor/tree-sitter-c new file mode 160000 index 000000000..e87026a96 --- /dev/null +++ b/languages/c/vendor/tree-sitter-c @@ -0,0 +1 @@ +Subproject commit e87026a962645ee225c12a75b1556293218e3f76