diff --git a/.editorconfig b/.editorconfig
index 7756ee9..65330c4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -41,3 +41,6 @@ indent_size = 8
[parser.c]
indent_size = 2
+
+[{alloc,array,parser}.h]
+indent_size = 2
diff --git a/.gitattributes b/.gitattributes
index 9d5c5d4..7e2cae0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,13 +1,37 @@
* text=auto eol=lf
+# Generated source files
src/*.json linguist-generated
src/parser.c linguist-generated
src/tree_sitter/* linguist-generated
-bindings/** linguist-generated
+# C bindings
+bindings/c/* linguist-generated
+CMakeLists.txt linguist-generated
+Makefile linguist-generated
+
+# Rust bindings
+bindings/rust/* linguist-generated
+Cargo.toml linguist-generated
+Cargo.lock linguist-generated
+
+# Node.js bindings
+bindings/node/* linguist-generated
binding.gyp linguist-generated
+package.json linguist-generated
+package-lock.json linguist-generated
+
+# Python bindings
+bindings/python/** linguist-generated
setup.py linguist-generated
-Makefile linguist-generated
-CMakeLists.txt linguist-generated
-Package.swift linguist-generated
+pyproject.toml linguist-generated
+
+# Go bindings
+bindings/go/* linguist-generated
go.mod linguist-generated
+go.sum linguist-generated
+
+# Swift bindings
+bindings/swift/** linguist-generated
+Package.swift linguist-generated
+Package.resolved linguist-generated
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 450d0d0..04f598c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -53,7 +53,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-python.pc"
install(TARGETS tree-sitter-python
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
-add_custom_target(test "${TREE_SITTER_CLI}" test
+add_custom_target(ts-test "${TREE_SITTER_CLI}" test
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "tree-sitter test")
diff --git a/Cargo.lock b/Cargo.lock
index 91eca3b..7c5353e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
-version = 3
+version = 4
[[package]]
name = "aho-corasick"
@@ -69,9 +69,9 @@ checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
[[package]]
name = "tree-sitter"
-version = "0.24.3"
+version = "0.24.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9871f16d6cf5c4757dcf30d5d2172a2df6987c510c017bbb7abfb7f9aa24d06"
+checksum = "b67baf55e7e1b6806063b1e51041069c90afff16afcbbccd278d899f9d84bca4"
dependencies = [
"cc",
"regex",
diff --git a/Cargo.toml b/Cargo.toml
index ad12c30..aa4fab6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,7 +15,7 @@ edition = "2021"
autoexamples = false
build = "bindings/rust/build.rs"
-include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
+include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*", "tree-sitter.json"]
[lib]
path = "bindings/rust/lib.rs"
diff --git a/Package.resolved b/Package.resolved
new file mode 100644
index 0000000..9e0a023
--- /dev/null
+++ b/Package.resolved
@@ -0,0 +1,16 @@
+{
+ "object": {
+ "pins": [
+ {
+ "package": "SwiftTreeSitter",
+ "repositoryURL": "https://github.com/ChimeHQ/SwiftTreeSitter",
+ "state": {
+ "branch": null,
+ "revision": "2599e95310b3159641469d8a21baf2d3d200e61f",
+ "version": "0.8.0"
+ }
+ }
+ ]
+ },
+ "version": 1
+}
diff --git a/bindings/c/tree-sitter-python.pc.in b/bindings/c/tree-sitter-python.pc.in
index 7b06a8d..95c672c 100644
--- a/bindings/c/tree-sitter-python.pc.in
+++ b/bindings/c/tree-sitter-python.pc.in
@@ -6,6 +6,5 @@ Name: tree-sitter-python
Description: @PROJECT_DESCRIPTION@
URL: @PROJECT_HOMEPAGE_URL@
Version: @PROJECT_VERSION@
-Requires: @TS_REQUIRES@
Libs: -L${libdir} -ltree-sitter-python
Cflags: -I${includedir}
diff --git a/bindings/node/binding_test.js b/bindings/node/binding_test.js
index afede30..55becac 100644
--- a/bindings/node/binding_test.js
+++ b/bindings/node/binding_test.js
@@ -1,9 +1,9 @@
-///
-
const assert = require("node:assert");
const { test } = require("node:test");
+const Parser = require("tree-sitter");
+
test("can load grammar", () => {
- const parser = new (require("tree-sitter"))();
+ const parser = new Parser();
assert.doesNotThrow(() => parser.setLanguage(require(".")));
});
diff --git a/bindings/node/index.js b/bindings/node/index.js
index 6657bcf..6f63f14 100644
--- a/bindings/node/index.js
+++ b/bindings/node/index.js
@@ -1,6 +1,10 @@
const root = require("path").join(__dirname, "..", "..");
-module.exports = require("node-gyp-build")(root);
+module.exports =
+ typeof process.versions.bun === "string"
+ // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
+ ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-python.node`)
+ : require("node-gyp-build")(root);
try {
module.exports.nodeTypeInfo = require("../../src/node-types.json");
diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs
index 133f2a2..7183aee 100644
--- a/bindings/rust/build.rs
+++ b/bindings/rust/build.rs
@@ -2,7 +2,10 @@ fn main() {
let src_dir = std::path::Path::new("src");
let mut c_config = cc::Build::new();
- c_config.include(src_dir).flag_if_supported("-Wno-unused");
+ c_config
+ .std("c11")
+ .include(src_dir)
+ .flag_if_supported("-Wno-unused-value");
#[cfg(target_env = "msvc")]
c_config.flag("-utf-8");
diff --git a/go.mod b/go.mod
index 3a9c53e..f5fefb7 100644
--- a/go.mod
+++ b/go.mod
@@ -1,9 +1,7 @@
module github.com/tree-sitter/tree-sitter-python
-go 1.23
+go 1.22
-toolchain go1.23.0
-
-require github.com/tree-sitter/go-tree-sitter v0.24.0 // indirect
+require github.com/tree-sitter/go-tree-sitter v0.24.0
require github.com/mattn/go-pointer v0.0.1 // indirect
diff --git a/go.sum b/go.sum
index 29c98e1..b37d4a2 100644
--- a/go.sum
+++ b/go.sum
@@ -6,8 +6,6 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
-github.com/tree-sitter/go-tree-sitter v0.23.1 h1:HCfaE19sKfG7q190xfM1loUZf6wEHa4TDqDEW46s9Lg=
-github.com/tree-sitter/go-tree-sitter v0.23.1/go.mod h1:EvIVhMvvPNvhu9x+ddSPxSnUEU5AnsSwi1LMqXIVE3A=
github.com/tree-sitter/go-tree-sitter v0.24.0 h1:kRZb6aBNfcI/u0Qh8XEt3zjNVnmxTisDBN+kXK0xRYQ=
github.com/tree-sitter/go-tree-sitter v0.24.0/go.mod h1:x681iFVoLMEwOSIHA1chaLkXlroXEN7WY+VHGFaoDbk=
github.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb h1:A8425heRM8mylnv4H58FPUiH+aYivyitre0PzxrfmWs=
diff --git a/package-lock.json b/package-lock.json
index 66f9aa8..6aeab9d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -10,17 +10,17 @@
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
- "node-addon-api": "^8.2.1",
+ "node-addon-api": "^8.2.2",
"node-gyp-build": "^4.8.2"
},
"devDependencies": {
- "eslint": "^9.12.0",
+ "eslint": "^9.14.0",
"eslint-config-treesitter": "^1.0.2",
"prebuildify": "^6.0.1",
- "tree-sitter-cli": "^0.24.3"
+ "tree-sitter-cli": "^0.24.4"
},
"peerDependencies": {
- "tree-sitter": "^0.21.0"
+ "tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree-sitter": {
@@ -58,9 +58,9 @@
}
},
"node_modules/@eslint-community/regexpp": {
- "version": "4.11.0",
- "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz",
- "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==",
+ "version": "4.12.1",
+ "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz",
+ "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
"dev": true,
"engines": {
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
@@ -81,9 +81,9 @@
}
},
"node_modules/@eslint/core": {
- "version": "0.6.0",
- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz",
- "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==",
+ "version": "0.7.0",
+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz",
+ "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -113,9 +113,9 @@
}
},
"node_modules/@eslint/js": {
- "version": "9.12.0",
- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz",
- "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==",
+ "version": "9.14.0",
+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz",
+ "integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -143,27 +143,40 @@
}
},
"node_modules/@humanfs/core": {
- "version": "0.19.0",
- "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz",
- "integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==",
+ "version": "0.19.1",
+ "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
+ "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
"dev": true,
"engines": {
"node": ">=18.18.0"
}
},
"node_modules/@humanfs/node": {
- "version": "0.16.5",
- "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz",
- "integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==",
+ "version": "0.16.6",
+ "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz",
+ "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==",
"dev": true,
"dependencies": {
- "@humanfs/core": "^0.19.0",
+ "@humanfs/core": "^0.19.1",
"@humanwhocodes/retry": "^0.3.0"
},
"engines": {
"node": ">=18.18.0"
}
},
+ "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": {
+ "version": "0.3.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
+ "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
+ "dev": true,
+ "engines": {
+ "node": ">=18.18"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/nzakas"
+ }
+ },
"node_modules/@humanwhocodes/module-importer": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
@@ -178,9 +191,9 @@
}
},
"node_modules/@humanwhocodes/retry": {
- "version": "0.3.1",
- "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
- "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
+ "version": "0.4.1",
+ "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz",
+ "integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==",
"dev": true,
"engines": {
"node": ">=18.18"
@@ -215,9 +228,9 @@
"dev": true
},
"node_modules/acorn": {
- "version": "8.12.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
- "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
+ "version": "8.14.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
+ "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
"dev": true,
"bin": {
"acorn": "bin/acorn"
@@ -481,21 +494,21 @@
}
},
"node_modules/eslint": {
- "version": "9.12.0",
- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz",
- "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==",
+ "version": "9.14.0",
+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz",
+ "integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==",
"dev": true,
"dependencies": {
"@eslint-community/eslint-utils": "^4.2.0",
- "@eslint-community/regexpp": "^4.11.0",
+ "@eslint-community/regexpp": "^4.12.1",
"@eslint/config-array": "^0.18.0",
- "@eslint/core": "^0.6.0",
+ "@eslint/core": "^0.7.0",
"@eslint/eslintrc": "^3.1.0",
- "@eslint/js": "9.12.0",
+ "@eslint/js": "9.14.0",
"@eslint/plugin-kit": "^0.2.0",
- "@humanfs/node": "^0.16.5",
+ "@humanfs/node": "^0.16.6",
"@humanwhocodes/module-importer": "^1.0.1",
- "@humanwhocodes/retry": "^0.3.1",
+ "@humanwhocodes/retry": "^0.4.0",
"@types/estree": "^1.0.6",
"@types/json-schema": "^7.0.15",
"ajv": "^6.12.4",
@@ -503,9 +516,9 @@
"cross-spawn": "^7.0.2",
"debug": "^4.3.2",
"escape-string-regexp": "^4.0.0",
- "eslint-scope": "^8.1.0",
- "eslint-visitor-keys": "^4.1.0",
- "espree": "^10.2.0",
+ "eslint-scope": "^8.2.0",
+ "eslint-visitor-keys": "^4.2.0",
+ "espree": "^10.3.0",
"esquery": "^1.5.0",
"esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3",
@@ -578,9 +591,9 @@
}
},
"node_modules/eslint-scope": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz",
- "integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==",
+ "version": "8.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
+ "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
"dev": true,
"dependencies": {
"esrecurse": "^4.3.0",
@@ -606,9 +619,9 @@
}
},
"node_modules/eslint/node_modules/eslint-visitor-keys": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz",
- "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+ "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -618,14 +631,14 @@
}
},
"node_modules/espree": {
- "version": "10.2.0",
- "resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz",
- "integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==",
+ "version": "10.3.0",
+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
+ "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
"dev": true,
"dependencies": {
- "acorn": "^8.12.0",
+ "acorn": "^8.14.0",
"acorn-jsx": "^5.3.2",
- "eslint-visitor-keys": "^4.1.0"
+ "eslint-visitor-keys": "^4.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -635,9 +648,9 @@
}
},
"node_modules/espree/node_modules/eslint-visitor-keys": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz",
- "integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==",
+ "version": "4.2.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
+ "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
"dev": true,
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1013,9 +1026,9 @@
}
},
"node_modules/node-addon-api": {
- "version": "8.2.1",
- "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.2.1.tgz",
- "integrity": "sha512-vmEOvxwiH8tlOcv4SyE8RH34rI5/nWVaigUeAUPawC6f0+HoDthwI0vkMu4tbtsZrXq6QXFfrkhjofzKEs5tpA==",
+ "version": "8.2.2",
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-8.2.2.tgz",
+ "integrity": "sha512-9emqXAKhVoNrQ792nLI/wpzPpJ/bj/YXxW0CvAau1+RdGBcCRF1Dmz7719zgVsQNrzHl9Tzn3ImZ4qWFarWL0A==",
"engines": {
"node": "^18 || ^20 || >= 21"
}
@@ -1386,9 +1399,9 @@
}
},
"node_modules/tree-sitter-cli": {
- "version": "0.24.3",
- "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.24.3.tgz",
- "integrity": "sha512-5vS0SiJf31tMTn9CYLsu5l18qXaw5MLFka3cuGxOB5f4TtgoUSK1Sog6rKmqBc7PvFJq37YcQBjj9giNy2cJPw==",
+ "version": "0.24.4",
+ "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.24.4.tgz",
+ "integrity": "sha512-I4sdtDidnujYL0tR0Re9q0UJt5KrITf2m+GMHjT4LH6IC6kpM6eLzSR7RS36Z4t5ZQBjDHvg2QUJHAWQi3P2TA==",
"dev": true,
"hasInstallScript": true,
"bin": {
diff --git a/package.json b/package.json
index 5ab8824..9242faf 100644
--- a/package.json
+++ b/package.json
@@ -2,16 +2,29 @@
"name": "tree-sitter-python",
"version": "0.23.2",
"description": "Python grammar for tree-sitter",
- "repository": "github:tree-sitter/tree-sitter-python",
+ "repository": "https://github.com/tree-sitter/tree-sitter-python",
"license": "MIT",
- "author": "Max Brunsfeld ",
+ "author": {
+ "name": "Max Brunsfeld",
+ "email": "maxbrunsfeld@gmail.com"
+ },
"contributors": [
- "Amaan Qureshi "
+ {
+ "name": "Amaan Qureshi",
+ "email": "amaanq12@gmail.com"
+ }
],
"main": "bindings/node",
"types": "bindings/node",
+ "keywords": [
+ "incremental",
+ "parsing",
+ "tree-sitter",
+ "python"
+ ],
"files": [
"grammar.js",
+ "tree-sitter.json",
"binding.gyp",
"prebuilds/**",
"bindings/node/*",
@@ -19,12 +32,6 @@
"src/**",
"*.wasm"
],
- "keywords": [
- "incremental",
- "parsing",
- "tree-sitter",
- "python"
- ],
"dependencies": {
"node-addon-api": "^8.2.1",
"node-gyp-build": "^4.8.2"
@@ -32,11 +39,11 @@
"devDependencies": {
"eslint": "^9.12.0",
"eslint-config-treesitter": "^1.0.2",
- "tree-sitter-cli": "^0.24.3",
- "prebuildify": "^6.0.1"
+ "prebuildify": "^6.0.1",
+ "tree-sitter-cli": "^0.24.3"
},
"peerDependencies": {
- "tree-sitter": "^0.21.0"
+ "tree-sitter": "^0.21.1"
},
"peerDependenciesMeta": {
"tree-sitter": {
@@ -49,16 +56,5 @@
"prestart": "tree-sitter build --wasm",
"start": "tree-sitter playground",
"test": "node --test bindings/node/*_test.js"
- },
- "tree-sitter": [
- {
- "scope": "source.python",
- "file-types": [
- "py"
- ],
- "injection-regex": "py",
- "highlights": "queries/highlights.scm",
- "tags": "queries/tags.scm"
- }
- ]
+ }
}
diff --git a/pyproject.toml b/pyproject.toml
index 275826a..6ca182f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -26,7 +26,7 @@ readme = "README.md"
Homepage = "https://github.com/tree-sitter/tree-sitter-python"
[project.optional-dependencies]
-core = ["tree-sitter~=0.23"]
+core = ["tree-sitter~=0.22"]
[tool.cibuildwheel]
build = "cp39-*"
diff --git a/src/grammar.json b/src/grammar.json
index 0f95791..16d4baf 100644
--- a/src/grammar.json
+++ b/src/grammar.json
@@ -1,4 +1,5 @@
{
+ "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
"name": "python",
"word": "identifier",
"rules": {