tree-sitter-devicetree 0.11.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- tree_sitter_devicetree-0.11.1/LICENSE +21 -0
- tree_sitter_devicetree-0.11.1/PKG-INFO +25 -0
- tree_sitter_devicetree-0.11.1/README.md +7 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree/__init__.py +5 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree/__init__.pyi +1 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree/binding.c +27 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree/py.typed +0 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/PKG-INFO +25 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/SOURCES.txt +15 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/dependency_links.txt +1 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/not-zip-safe +1 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/requires.txt +3 -0
- tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/top_level.txt +2 -0
- tree_sitter_devicetree-0.11.1/pyproject.toml +29 -0
- tree_sitter_devicetree-0.11.1/setup.cfg +4 -0
- tree_sitter_devicetree-0.11.1/setup.py +57 -0
- tree_sitter_devicetree-0.11.1/src/parser.c +36032 -0
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Joel Spadin
|
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,25 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: tree-sitter-devicetree
|
3
|
+
Version: 0.11.1
|
4
|
+
Summary: Devicetree grammar for tree-sitter
|
5
|
+
License: MIT
|
6
|
+
Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-devicetree
|
7
|
+
Keywords: incremental,parsing,tree-sitter,devicetree
|
8
|
+
Classifier: Intended Audience :: Developers
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
12
|
+
Classifier: Typing :: Typed
|
13
|
+
Requires-Python: >=3.9
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
License-File: LICENSE
|
16
|
+
Provides-Extra: core
|
17
|
+
Requires-Dist: tree-sitter~=0.21; extra == "core"
|
18
|
+
|
19
|
+
# tree-sitter-devicetree
|
20
|
+
|
21
|
+
A [tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for Devicetree
|
22
|
+
with support for [Zephyr's](https://github.com/zephyrproject-rtos/zephyr)
|
23
|
+
superset of Devicetree syntax.
|
24
|
+
|
25
|
+
Some parts of the grammar are adapted from [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c).
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# tree-sitter-devicetree
|
2
|
+
|
3
|
+
A [tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for Devicetree
|
4
|
+
with support for [Zephyr's](https://github.com/zephyrproject-rtos/zephyr)
|
5
|
+
superset of Devicetree syntax.
|
6
|
+
|
7
|
+
Some parts of the grammar are adapted from [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c).
|
@@ -0,0 +1 @@
|
|
1
|
+
def language() -> int: ...
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#include <Python.h>
|
2
|
+
|
3
|
+
typedef struct TSLanguage TSLanguage;
|
4
|
+
|
5
|
+
TSLanguage *tree_sitter_devicetree(void);
|
6
|
+
|
7
|
+
static PyObject* _binding_language(PyObject *self, PyObject *args) {
|
8
|
+
return PyLong_FromVoidPtr(tree_sitter_devicetree());
|
9
|
+
}
|
10
|
+
|
11
|
+
static PyMethodDef methods[] = {
|
12
|
+
{"language", _binding_language, METH_NOARGS,
|
13
|
+
"Get the tree-sitter language for this grammar."},
|
14
|
+
{NULL, NULL, 0, NULL}
|
15
|
+
};
|
16
|
+
|
17
|
+
static struct PyModuleDef module = {
|
18
|
+
.m_base = PyModuleDef_HEAD_INIT,
|
19
|
+
.m_name = "_binding",
|
20
|
+
.m_doc = NULL,
|
21
|
+
.m_size = -1,
|
22
|
+
.m_methods = methods
|
23
|
+
};
|
24
|
+
|
25
|
+
PyMODINIT_FUNC PyInit__binding(void) {
|
26
|
+
return PyModule_Create(&module);
|
27
|
+
}
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: tree-sitter-devicetree
|
3
|
+
Version: 0.11.1
|
4
|
+
Summary: Devicetree grammar for tree-sitter
|
5
|
+
License: MIT
|
6
|
+
Project-URL: Homepage, https://github.com/tree-sitter/tree-sitter-devicetree
|
7
|
+
Keywords: incremental,parsing,tree-sitter,devicetree
|
8
|
+
Classifier: Intended Audience :: Developers
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
10
|
+
Classifier: Topic :: Software Development :: Compilers
|
11
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
12
|
+
Classifier: Typing :: Typed
|
13
|
+
Requires-Python: >=3.9
|
14
|
+
Description-Content-Type: text/markdown
|
15
|
+
License-File: LICENSE
|
16
|
+
Provides-Extra: core
|
17
|
+
Requires-Dist: tree-sitter~=0.21; extra == "core"
|
18
|
+
|
19
|
+
# tree-sitter-devicetree
|
20
|
+
|
21
|
+
A [tree-sitter](https://github.com/tree-sitter/tree-sitter) grammar for Devicetree
|
22
|
+
with support for [Zephyr's](https://github.com/zephyrproject-rtos/zephyr)
|
23
|
+
superset of Devicetree syntax.
|
24
|
+
|
25
|
+
Some parts of the grammar are adapted from [tree-sitter-c](https://github.com/tree-sitter/tree-sitter-c).
|
@@ -0,0 +1,15 @@
|
|
1
|
+
LICENSE
|
2
|
+
README.md
|
3
|
+
pyproject.toml
|
4
|
+
setup.py
|
5
|
+
bindings/python/tree_sitter_devicetree/__init__.py
|
6
|
+
bindings/python/tree_sitter_devicetree/__init__.pyi
|
7
|
+
bindings/python/tree_sitter_devicetree/binding.c
|
8
|
+
bindings/python/tree_sitter_devicetree/py.typed
|
9
|
+
bindings/python/tree_sitter_devicetree.egg-info/PKG-INFO
|
10
|
+
bindings/python/tree_sitter_devicetree.egg-info/SOURCES.txt
|
11
|
+
bindings/python/tree_sitter_devicetree.egg-info/dependency_links.txt
|
12
|
+
bindings/python/tree_sitter_devicetree.egg-info/not-zip-safe
|
13
|
+
bindings/python/tree_sitter_devicetree.egg-info/requires.txt
|
14
|
+
bindings/python/tree_sitter_devicetree.egg-info/top_level.txt
|
15
|
+
src/parser.c
|
tree_sitter_devicetree-0.11.1/bindings/python/tree_sitter_devicetree.egg-info/dependency_links.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
[build-system]
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
3
|
+
build-backend = "setuptools.build_meta"
|
4
|
+
|
5
|
+
[project]
|
6
|
+
name = "tree-sitter-devicetree"
|
7
|
+
description = "Devicetree grammar for tree-sitter"
|
8
|
+
version = "0.11.1"
|
9
|
+
keywords = ["incremental", "parsing", "tree-sitter", "devicetree"]
|
10
|
+
classifiers = [
|
11
|
+
"Intended Audience :: Developers",
|
12
|
+
"License :: OSI Approved :: MIT License",
|
13
|
+
"Topic :: Software Development :: Compilers",
|
14
|
+
"Topic :: Text Processing :: Linguistic",
|
15
|
+
"Typing :: Typed"
|
16
|
+
]
|
17
|
+
requires-python = ">=3.9"
|
18
|
+
license.text = "MIT"
|
19
|
+
readme = "README.md"
|
20
|
+
|
21
|
+
[project.urls]
|
22
|
+
Homepage = "https://github.com/tree-sitter/tree-sitter-devicetree"
|
23
|
+
|
24
|
+
[project.optional-dependencies]
|
25
|
+
core = ["tree-sitter~=0.21"]
|
26
|
+
|
27
|
+
[tool.cibuildwheel]
|
28
|
+
build = "cp39-*"
|
29
|
+
build-frontend = "build"
|
@@ -0,0 +1,57 @@
|
|
1
|
+
from os.path import isdir, join
|
2
|
+
from platform import system
|
3
|
+
|
4
|
+
from setuptools import Extension, find_packages, setup
|
5
|
+
from setuptools.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_devicetree", "queries")
|
13
|
+
self.copy_tree("queries", dest)
|
14
|
+
super().run()
|
15
|
+
|
16
|
+
|
17
|
+
class BdistWheel(bdist_wheel):
|
18
|
+
def get_tag(self):
|
19
|
+
python, abi, platform = super().get_tag()
|
20
|
+
if python.startswith("cp"):
|
21
|
+
python, abi = "cp38", "abi3"
|
22
|
+
return python, abi, platform
|
23
|
+
|
24
|
+
|
25
|
+
setup(
|
26
|
+
packages=find_packages("bindings/python"),
|
27
|
+
package_dir={"": "bindings/python"},
|
28
|
+
package_data={
|
29
|
+
"tree_sitter_devicetree": ["*.pyi", "py.typed"],
|
30
|
+
"tree_sitter_devicetree.queries": ["*.scm"],
|
31
|
+
},
|
32
|
+
ext_package="tree_sitter_devicetree",
|
33
|
+
ext_modules=[
|
34
|
+
Extension(
|
35
|
+
name="_binding",
|
36
|
+
sources=[
|
37
|
+
"bindings/python/tree_sitter_devicetree/binding.c",
|
38
|
+
"src/parser.c",
|
39
|
+
# NOTE: if your language uses an external scanner, add it here.
|
40
|
+
],
|
41
|
+
extra_compile_args=(
|
42
|
+
["-std=c11"] if system() != 'Windows' else []
|
43
|
+
),
|
44
|
+
define_macros=[
|
45
|
+
("Py_LIMITED_API", "0x03080000"),
|
46
|
+
("PY_SSIZE_T_CLEAN", None)
|
47
|
+
],
|
48
|
+
include_dirs=["src"],
|
49
|
+
py_limited_api=True,
|
50
|
+
)
|
51
|
+
],
|
52
|
+
cmdclass={
|
53
|
+
"build": Build,
|
54
|
+
"bdist_wheel": BdistWheel
|
55
|
+
},
|
56
|
+
zip_safe=False
|
57
|
+
)
|