-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# v0.1.0.0 | ||
|
||
* add tree-sitter-r parser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Distribution.Simple | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module TreeSitter.R | ||
( tree_sitter_r | ||
, getNodeTypesPath | ||
, getTestCorpusDir | ||
) where | ||
|
||
import Foreign.Ptr | ||
import TreeSitter.Language | ||
import Paths_tree_sitter_r | ||
|
||
foreign import ccall unsafe "vendor/tree-sitter-r/src/parser.c tree_sitter_r" tree_sitter_r :: Ptr Language | ||
|
||
getNodeTypesPath :: IO FilePath | ||
getNodeTypesPath = getDataFileName "vendor/tree-sitter-r/src/node-types.json" | ||
|
||
getTestCorpusDir :: IO FilePath | ||
getTestCorpusDir = getDataFileName "vendor/tree-sitter-r/corpus" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
cabal-version: 2.4 | ||
name: tree-sitter-r | ||
version: 0.1.0.0 | ||
synopsis: Tree-sitter grammar/parser for R | ||
description: This package provides a parser for R suitable for use with the tree-sitter package. | ||
license: BSD-3-Clause | ||
homepage: https://github.com/tree-sitter/haskell-tree-sitter/tree/master/tree-sitter-r | ||
maintainer: [email protected] | ||
copyright: 2020 GitHub, RStudio | ||
category: Tree-sitter, R | ||
build-type: Simple | ||
data-files: vendor/tree-sitter-r/src/node-types.json | ||
extra-source-files: ChangeLog.md | ||
|
||
common common | ||
default-language: Haskell2010 | ||
ghc-options: | ||
-Weverything | ||
-Wno-all-missed-specialisations | ||
-Wno-implicit-prelude | ||
-Wno-missed-specialisations | ||
-Wno-missing-import-lists | ||
-Wno-missing-local-signatures | ||
-Wno-monomorphism-restriction | ||
-Wno-name-shadowing | ||
-Wno-safe | ||
-Wno-unsafe | ||
if (impl(ghc >= 8.6)) | ||
ghc-options: -Wno-star-is-type | ||
if (impl(ghc >= 8.8)) | ||
ghc-options: -Wno-missing-deriving-strategies | ||
|
||
library | ||
import: common | ||
exposed-modules: TreeSitter.R | ||
autogen-modules: Paths_tree_sitter_r | ||
other-modules: Paths_tree_sitter_r | ||
build-depends: base >= 4.12 && < 5 | ||
, tree-sitter ^>= 0.9.0.0 | ||
Include-dirs: vendor/tree-sitter-r/src | ||
install-includes: tree_sitter/parser.h | ||
c-sources: vendor/tree-sitter-r/src/parser.c | ||
extra-libraries: stdc++ | ||
|
||
source-repository head | ||
type: git | ||
location: https://github.com/tree-sitter/haskell-tree-sitter |
Submodule tree-sitter-r
added at
440a30