tree-sitter-opencl 0.0.1__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-opencl-0.0.1/LICENSE +21 -0
- tree-sitter-opencl-0.0.1/PKG-INFO +4 -0
- tree-sitter-opencl-0.0.1/README.md +4 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl/__init__.py +5 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl/__init__.pyi +1 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl/binding.c +35 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl/py.typed +0 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl.egg-info/PKG-INFO +4 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl.egg-info/SOURCES.txt +19 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl.egg-info/dependency_links.txt +1 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl.egg-info/not-zip-safe +1 -0
- tree-sitter-opencl-0.0.1/bindings/python/tree_sitter_opencl.egg-info/top_level.txt +2 -0
- tree-sitter-opencl-0.0.1/setup.cfg +4 -0
- tree-sitter-opencl-0.0.1/setup.py +50 -0
- tree-sitter-opencl-0.0.1/src/parser.c +100715 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014 Max Brunsfeld (C version), 2023 Peter Lef (OpenCL C modifications).
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
def language() -> object: ...
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#include <Python.h>
|
|
2
|
+
|
|
3
|
+
typedef struct TSLanguage TSLanguage;
|
|
4
|
+
|
|
5
|
+
TSLanguage *tree_sitter_opencl(void);
|
|
6
|
+
|
|
7
|
+
static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
|
|
8
|
+
return PyCapsule_New(tree_sitter_opencl(), "tree_sitter.Language", NULL);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static struct PyModuleDef_Slot slots[] = {
|
|
12
|
+
#ifdef Py_GIL_DISABLED
|
|
13
|
+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
|
14
|
+
#endif
|
|
15
|
+
{0, NULL}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
static PyMethodDef methods[] = {
|
|
19
|
+
{"language", _binding_language, METH_NOARGS,
|
|
20
|
+
"Get the tree-sitter language for this grammar."},
|
|
21
|
+
{NULL, NULL, 0, NULL}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
static struct PyModuleDef module = {
|
|
25
|
+
.m_base = PyModuleDef_HEAD_INIT,
|
|
26
|
+
.m_name = "_binding",
|
|
27
|
+
.m_doc = NULL,
|
|
28
|
+
.m_size = 0,
|
|
29
|
+
.m_methods = methods,
|
|
30
|
+
.m_slots = slots,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
PyMODINIT_FUNC PyInit__binding(void) {
|
|
34
|
+
return PyModuleDef_Init(&module);
|
|
35
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
bindings/python/tree_sitter_opencl/binding.c
|
|
5
|
+
bindings/python/tree_sitter_opencl.egg-info/PKG-INFO
|
|
6
|
+
bindings/python/tree_sitter_opencl.egg-info/SOURCES.txt
|
|
7
|
+
bindings/python/tree_sitter_opencl.egg-info/dependency_links.txt
|
|
8
|
+
bindings/python/tree_sitter_opencl.egg-info/not-zip-safe
|
|
9
|
+
bindings/python/tree_sitter_opencl.egg-info/top_level.txt
|
|
10
|
+
bindings/python/tree_sitter_opencl/__init__.py
|
|
11
|
+
bindings/python/tree_sitter_opencl/__init__.pyi
|
|
12
|
+
bindings/python/tree_sitter_opencl/binding.c
|
|
13
|
+
bindings/python/tree_sitter_opencl/py.typed
|
|
14
|
+
bindings/python/tree_sitter_opencl.egg-info/PKG-INFO
|
|
15
|
+
bindings/python/tree_sitter_opencl.egg-info/SOURCES.txt
|
|
16
|
+
bindings/python/tree_sitter_opencl.egg-info/dependency_links.txt
|
|
17
|
+
bindings/python/tree_sitter_opencl.egg-info/not-zip-safe
|
|
18
|
+
bindings/python/tree_sitter_opencl.egg-info/top_level.txt
|
|
19
|
+
src/parser.c
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
from os.path import isdir, join
|
|
2
|
+
from platform import system
|
|
3
|
+
|
|
4
|
+
from setuptools import Extension, find_packages, setup
|
|
5
|
+
from distutils.command.build import build
|
|
6
|
+
from wheel.bdist_wheel import bdist_wheel
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Build(build):
|
|
10
|
+
def run(self):
|
|
11
|
+
if isdir("queries"):
|
|
12
|
+
dest = join(self.build_lib, "tree_sitter_opencl", "queries")
|
|
13
|
+
self.copy_tree("queries", dest)
|
|
14
|
+
super().run()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
setup(
|
|
18
|
+
name="tree-sitter-opencl",
|
|
19
|
+
version="0.0.1",
|
|
20
|
+
packages=find_packages("bindings/python"),
|
|
21
|
+
package_dir={"": "bindings/python"},
|
|
22
|
+
package_data={
|
|
23
|
+
"tree_sitter_opencl": ["*.pyi", "py.typed"],
|
|
24
|
+
"tree_sitter_opencl.queries": ["*.scm"],
|
|
25
|
+
},
|
|
26
|
+
ext_package="tree_sitter_opencl",
|
|
27
|
+
ext_modules=[
|
|
28
|
+
Extension(
|
|
29
|
+
name="_binding",
|
|
30
|
+
sources=[
|
|
31
|
+
"bindings/python/tree_sitter_opencl/binding.c",
|
|
32
|
+
"src/parser.c",
|
|
33
|
+
# NOTE: if your language uses an external scanner, add it here.
|
|
34
|
+
],
|
|
35
|
+
extra_compile_args=(
|
|
36
|
+
["-std=c11"] if system() != 'Windows' else []
|
|
37
|
+
),
|
|
38
|
+
define_macros=[
|
|
39
|
+
("Py_LIMITED_API", "0x03070000"),
|
|
40
|
+
("PY_SSIZE_T_CLEAN", None)
|
|
41
|
+
],
|
|
42
|
+
include_dirs=["src"],
|
|
43
|
+
py_limited_api=True,
|
|
44
|
+
)
|
|
45
|
+
],
|
|
46
|
+
cmdclass={
|
|
47
|
+
"build": Build
|
|
48
|
+
},
|
|
49
|
+
zip_safe=False
|
|
50
|
+
)
|