Skip to content

Commit

Permalink
feat: improve bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Feb 26, 2024
1 parent 671bb1b commit 27f866b
Show file tree
Hide file tree
Showing 27 changed files with 794 additions and 71 deletions.
39 changes: 39 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{json,toml,yml,gyp}]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[*.rs]
indent_style = space
indent_size = 4

[*.{c,cc,h}]
indent_style = space
indent_size = 4

[*.{py,pyi}]
indent_style = space
indent_size = 4

[*.swift]
indent_style = space
indent_size = 4

[*.go]
indent_style = tab
indent_size = 8

[Makefile]
indent_style = tab
indent_size = 8
14 changes: 7 additions & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/src/** linguist-vendored
/examples/* linguist-vendored
* text eol=lf

src/grammar.json linguist-generated
src/node-types.json linguist-generated
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated

src/grammar.json -diff
src/node-types.json -diff
src/parser.c -diff
bindings/** linguist-generated
binding.gyp linguist-generated
setup.py linguist-generated
Makefile linguist-generated
21 changes: 16 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
/test
/examples
/build
/script
/target
bindings/c
bindings/go
bindings/python
bindings/rust
bindings/swift
Cargo.toml
Makefile
examples
pyproject.toml
setup.py
test
.editorconfig
.github
.gitignore
.gitattributes
.gitmodules
.npmignore
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name = "tree-sitter-python"
description = "Python grammar for tree-sitter"
version = "0.20.4"
authors = [
"Max Brunsfeld <[email protected]>",
"Douglas Creager <[email protected]>",
"Max Brunsfeld <[email protected]>",
"Douglas Creager <[email protected]>",
]
license = "MIT"
readme = "bindings/rust/README.md"
Expand All @@ -21,7 +21,7 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
path = "bindings/rust/lib.rs"

[dependencies]
tree-sitter = "~0.20.10"
tree-sitter = "0.21.0"

[build-dependencies]
cc = "~1.0"
cc = "1.0.88"
94 changes: 94 additions & 0 deletions Makefile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 21 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PackageDescription

let package = Package(
name: "TreeSitterPython",
platforms: [.macOS(.v10_13), .iOS(.v11)],
products: [
.library(name: "TreeSitterPython", targets: ["TreeSitterPython"]),
],
Expand All @@ -11,18 +12,32 @@ let package = Package(
.target(name: "TreeSitterPython",
path: ".",
exclude: [
"binding.gyp",
"bindings",
"Cargo.toml",
"corpus",
"Makefile",
"binding.gyp",
"bindings/c",
"bindings/go",
"bindings/node",
"bindings/python",
"bindings/rust",
"examples",
"grammar.js",
"LICENSE",
"package.json",
"README.md",
"package-lock.json",
"pyproject.toml",
"setup.py",
"test",
"types",
".editorconfig",
".github",
".gitignore",
".gitattributes",
".gitmodules",
".npmignore",
],
sources: [
"src/parser.c",
"src/scanner.c",
// NOTE: if your language has an external scanner, add it here.
],
resources: [
.copy("queries")
Expand Down
9 changes: 6 additions & 3 deletions binding.gyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions bindings/c/tree-sitter-python.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bindings/c/tree-sitter-python.pc.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions bindings/go/binding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions bindings/go/binding_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions bindings/go/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions bindings/node/binding.cc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions bindings/node/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions bindings/python/build/lib/tree_sitter_python/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bindings/python/tree_sitter_python/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 27f866b

Please sign in to comment.