tree-sitter-python-orchard 0.4.1__tar.gz → 0.4.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- tree-sitter-python-orchard-0.4.3/PKG-INFO +48 -0
- tree-sitter-python-orchard-0.4.3/README.md +31 -0
- tree-sitter-python-orchard-0.4.3/bindings/python/tree_sitter_python_orchard/__init__.py +43 -0
- tree-sitter-python-orchard-0.4.3/bindings/python/tree_sitter_python_orchard/__init__.pyi +17 -0
- tree-sitter-python-orchard-0.4.3/bindings/python/tree_sitter_python_orchard.egg-info/PKG-INFO +48 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/pyproject.toml +2 -2
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/setup.py +1 -1
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/src/parser.c +240 -225
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/src/tree_sitter/array.h +118 -73
- tree-sitter-python-orchard-0.4.1/PKG-INFO +0 -30
- tree-sitter-python-orchard-0.4.1/README.md +0 -13
- tree-sitter-python-orchard-0.4.1/bindings/python/tree_sitter_python_orchard/__init__.py +0 -42
- tree-sitter-python-orchard-0.4.1/bindings/python/tree_sitter_python_orchard/__init__.pyi +0 -10
- tree-sitter-python-orchard-0.4.1/bindings/python/tree_sitter_python_orchard.egg-info/PKG-INFO +0 -30
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/LICENSE +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard/binding.c +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard/py.typed +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard.egg-info/SOURCES.txt +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard.egg-info/dependency_links.txt +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard.egg-info/not-zip-safe +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard.egg-info/requires.txt +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/bindings/python/tree_sitter_python_orchard.egg-info/top_level.txt +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/queries/highlights.scm +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/queries/tags.scm +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/setup.cfg +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/src/tree_sitter/alloc.h +0 -0
- {tree-sitter-python-orchard-0.4.1 → tree-sitter-python-orchard-0.4.3}/src/tree_sitter/parser.h +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tree-sitter-python-orchard
|
|
3
|
+
Version: 0.4.3
|
|
4
|
+
Summary: Parser for Python files
|
|
5
|
+
Author-email: Max Brunsfeld <maxbrunsfeld@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://codeberg.org/grammar-orchard/tree-sitter-python-orchard
|
|
8
|
+
Keywords: incremental,parsing,tree-sitter,python-orchard
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Provides-Extra: core
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
|
|
18
|
+
# tree-sitter-python-orchard
|
|
19
|
+
|
|
20
|
+
[![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
|
|
21
|
+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
|
|
22
|
+
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
|
|
23
|
+
|
|
24
|
+
This is a tree-sitter grammar for Python.
|
|
25
|
+
|
|
26
|
+
### Using it
|
|
27
|
+
|
|
28
|
+
You can obtain this parser in various formats:
|
|
29
|
+
* as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
|
|
30
|
+
* as a Rust crate: `cargo add tree-sitter-python-orchard`
|
|
31
|
+
* as a Python package: `pip install tree-sitter-python-orchard`
|
|
32
|
+
* as an NPM package: `npm install tree-sitter-python-orchard`
|
|
33
|
+
|
|
34
|
+
### Contributing
|
|
35
|
+
|
|
36
|
+
Contributions are welcome, so are co-maintainers.
|
|
37
|
+
|
|
38
|
+
Unlike many grammar repositories, this one does not track generated files.
|
|
39
|
+
After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
|
|
40
|
+
If you want to use it via bindings, you'll also need to run `tree-sitter init`.
|
|
41
|
+
|
|
42
|
+
### Origin
|
|
43
|
+
|
|
44
|
+
This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
|
|
45
|
+
|
|
46
|
+
[crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
|
|
47
|
+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
|
|
48
|
+
[npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# tree-sitter-python-orchard
|
|
2
|
+
|
|
3
|
+
[![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
|
|
4
|
+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
|
|
5
|
+
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
|
|
6
|
+
|
|
7
|
+
This is a tree-sitter grammar for Python.
|
|
8
|
+
|
|
9
|
+
### Using it
|
|
10
|
+
|
|
11
|
+
You can obtain this parser in various formats:
|
|
12
|
+
* as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
|
|
13
|
+
* as a Rust crate: `cargo add tree-sitter-python-orchard`
|
|
14
|
+
* as a Python package: `pip install tree-sitter-python-orchard`
|
|
15
|
+
* as an NPM package: `npm install tree-sitter-python-orchard`
|
|
16
|
+
|
|
17
|
+
### Contributing
|
|
18
|
+
|
|
19
|
+
Contributions are welcome, so are co-maintainers.
|
|
20
|
+
|
|
21
|
+
Unlike many grammar repositories, this one does not track generated files.
|
|
22
|
+
After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
|
|
23
|
+
If you want to use it via bindings, you'll also need to run `tree-sitter init`.
|
|
24
|
+
|
|
25
|
+
### Origin
|
|
26
|
+
|
|
27
|
+
This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
|
|
28
|
+
|
|
29
|
+
[crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
|
|
30
|
+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
|
|
31
|
+
[npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"""Parser for Python files"""
|
|
2
|
+
|
|
3
|
+
from importlib.resources import files as _files
|
|
4
|
+
|
|
5
|
+
from ._binding import language
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _get_query(name, file):
|
|
9
|
+
try:
|
|
10
|
+
query = _files(f"{__package__}") / file
|
|
11
|
+
globals()[name] = query.read_text()
|
|
12
|
+
except FileNotFoundError:
|
|
13
|
+
globals()[name] = None
|
|
14
|
+
return globals()[name]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def __getattr__(name):
|
|
18
|
+
if name == "HIGHLIGHTS_QUERY":
|
|
19
|
+
return _get_query("HIGHLIGHTS_QUERY", "queries/highlights.scm")
|
|
20
|
+
if name == "INJECTIONS_QUERY":
|
|
21
|
+
return _get_query("INJECTIONS_QUERY", "queries/injections.scm")
|
|
22
|
+
if name == "LOCALS_QUERY":
|
|
23
|
+
return _get_query("LOCALS_QUERY", "queries/locals.scm")
|
|
24
|
+
if name == "TAGS_QUERY":
|
|
25
|
+
return _get_query("TAGS_QUERY", "queries/tags.scm")
|
|
26
|
+
|
|
27
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
"language",
|
|
32
|
+
"HIGHLIGHTS_QUERY",
|
|
33
|
+
"INJECTIONS_QUERY",
|
|
34
|
+
"LOCALS_QUERY",
|
|
35
|
+
"TAGS_QUERY",
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __dir__():
|
|
40
|
+
return sorted(__all__ + [
|
|
41
|
+
"__all__", "__builtins__", "__cached__", "__doc__", "__file__",
|
|
42
|
+
"__loader__", "__name__", "__package__", "__path__", "__spec__",
|
|
43
|
+
])
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from typing import Final
|
|
2
|
+
from typing_extensions import CapsuleType
|
|
3
|
+
|
|
4
|
+
HIGHLIGHTS_QUERY: Final[str] | None
|
|
5
|
+
"""The syntax highlighting query for this grammar."""
|
|
6
|
+
|
|
7
|
+
INJECTIONS_QUERY: Final[str] | None
|
|
8
|
+
"""The language injection query for this grammar."""
|
|
9
|
+
|
|
10
|
+
LOCALS_QUERY: Final[str] | None
|
|
11
|
+
"""The local variable query for this grammar."""
|
|
12
|
+
|
|
13
|
+
TAGS_QUERY: Final[str] | None
|
|
14
|
+
"""The symbol tagging query for this grammar."""
|
|
15
|
+
|
|
16
|
+
def language() -> CapsuleType:
|
|
17
|
+
"""The tree-sitter language function for this grammar."""
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: tree-sitter-python-orchard
|
|
3
|
+
Version: 0.4.3
|
|
4
|
+
Summary: Parser for Python files
|
|
5
|
+
Author-email: Max Brunsfeld <maxbrunsfeld@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://codeberg.org/grammar-orchard/tree-sitter-python-orchard
|
|
8
|
+
Keywords: incremental,parsing,tree-sitter,python-orchard
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
12
|
+
Classifier: Typing :: Typed
|
|
13
|
+
Requires-Python: >=3.10
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
Provides-Extra: core
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
|
|
18
|
+
# tree-sitter-python-orchard
|
|
19
|
+
|
|
20
|
+
[![crates][crates]](https://crates.io/crates/tree-sitter-python-orchard)
|
|
21
|
+
[![pypi][pypi]](https://pypi.org/project/tree-sitter-python-orchard)
|
|
22
|
+
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-python-orchard)
|
|
23
|
+
|
|
24
|
+
This is a tree-sitter grammar for Python.
|
|
25
|
+
|
|
26
|
+
### Using it
|
|
27
|
+
|
|
28
|
+
You can obtain this parser in various formats:
|
|
29
|
+
* as an archive from [the Releases page](/grammar-orchard/tree-sitter-python-orchard/releases), which contains all the generated files (bindings, parser code)
|
|
30
|
+
* as a Rust crate: `cargo add tree-sitter-python-orchard`
|
|
31
|
+
* as a Python package: `pip install tree-sitter-python-orchard`
|
|
32
|
+
* as an NPM package: `npm install tree-sitter-python-orchard`
|
|
33
|
+
|
|
34
|
+
### Contributing
|
|
35
|
+
|
|
36
|
+
Contributions are welcome, so are co-maintainers.
|
|
37
|
+
|
|
38
|
+
Unlike many grammar repositories, this one does not track generated files.
|
|
39
|
+
After cloning this repository, you'll need to run `tree-sitter generate` to obtain the parser.
|
|
40
|
+
If you want to use it via bindings, you'll also need to run `tree-sitter init`.
|
|
41
|
+
|
|
42
|
+
### Origin
|
|
43
|
+
|
|
44
|
+
This project was forked from https://github.com/tree-sitter/tree-sitter-python, to [ease the use of and collaboration on this grammar](https://codeberg.org/grammar-orchard#for-contributors).
|
|
45
|
+
|
|
46
|
+
[crates]: https://img.shields.io/crates/v/tree-sitter-python-orchard?logo=rust
|
|
47
|
+
[pypi]: https://img.shields.io/pypi/v/tree-sitter-python-orchard?logo=pypi&logoColor=ffd242
|
|
48
|
+
[npm]: https://img.shields.io/npm/v/tree-sitter-python-orchard?logo=npm
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "tree-sitter-python-orchard"
|
|
7
7
|
description = "Parser for Python files"
|
|
8
|
-
version = "0.4.
|
|
8
|
+
version = "0.4.3"
|
|
9
9
|
keywords = ["incremental", "parsing", "tree-sitter", "python-orchard"]
|
|
10
10
|
classifiers = [
|
|
11
11
|
"Intended Audience :: Developers",
|
|
@@ -19,7 +19,7 @@ license.text = "MIT"
|
|
|
19
19
|
readme = "README.md"
|
|
20
20
|
|
|
21
21
|
[project.urls]
|
|
22
|
-
Homepage = "https://codeberg.org/grammar-orchard/tree-
|
|
22
|
+
Homepage = "https://codeberg.org/grammar-orchard/tree-sitter-python-orchard"
|
|
23
23
|
|
|
24
24
|
[project.optional-dependencies]
|
|
25
25
|
core = ["tree-sitter~=0.24"]
|
|
@@ -32,7 +32,7 @@ class BuildExt(build_ext):
|
|
|
32
32
|
class BdistWheel(bdist_wheel):
|
|
33
33
|
def get_tag(self):
|
|
34
34
|
python, abi, platform = super().get_tag()
|
|
35
|
-
if python.startswith("cp"):
|
|
35
|
+
if python.startswith("cp") and not get_config_var("Py_GIL_DISABLED"):
|
|
36
36
|
python, abi = "cp310", "abi3"
|
|
37
37
|
return python, abi, platform
|
|
38
38
|
|